Page 1 of 1

csproj import statement does not fully function

Posted: Tue Jan 23, 2018 5:32 pm
by jasper
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

Re: csproj import statement does not fully function

Posted: Fri Jan 26, 2018 7:12 pm
by Vega
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?