csproj import statement does not fully function

Ask general questions here.
jasper
Posts: 1
Joined: Tue Jan 23, 2018 5:14 pm

csproj import statement does not fully function

Post by jasper » Tue Jan 23, 2018 5:32 pm

We would like to import the properties for a project into the csproj file.

For instance
<Import Project="MyProperties.props" />

And in this file something like

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="etcetera">
<PropertyGroup>
<MyCustomProperty>my value</MyCustomProperty>
</PropertyGroup>
</Project>

Whatever we try, Ranorex does not pick the value's up from the imported file.
We can use the csproj files with MSBuild however we would like to maintain the project files in Ranorex studio and use the value's defined in the .props file.

Hope you have a solution on this matter.

Kind regards,
Jasper de Keijzer

Vega
Posts: 222
Joined: Tue Jan 17, 2023 7:50 pm

Re: csproj import statement does not fully function

Post by Vega » Fri Jan 26, 2018 7:12 pm

I was able to get this working with the below:

MyProperties.props:

Code: Select all

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <OutputPath>tester</OutputPath>
    </PropertyGroup>
</Project>
In my csproj I have:

Code: Select all

<Import Project="MyProperties.props" />
And I can see that these properties are picked up when building in Ranorex studio and build to the custom build path. If this does not work for you, are you able to provide a small sample solution and your expected results?