Visual Studio keeps adding property to my csproj. Why?

后端 未结 4 1384
没有蜡笔的小新
没有蜡笔的小新 2021-01-17 14:46

I\'m using Visual Studio 2012 RC to work with my C# solution. All my configuration-specific settings are stored within a single .props file which is then included by all my

4条回答
  •  南笙
    南笙 (楼主)
    2021-01-17 14:57

    If the insertion of the XML is happening during loading I suspect it is NuGet related (assuming you are using NuGet). If you use a Directory.Build.props file you can get the BaseIntermediateOuputPath set in the .props file. Read this stackoverflow article for some important info on the search order and process of how that works.

    Autogenerated IntermediateOutputPath in the .csproj file

    Setting BaseIntermediateOutputPath in your project file will not redirect NuGet because its value is set after MSBuild includes Sdk.props which sets the BaseIintermediateOutputPath. There are two solutions to this issue. Use the Directory.Build.props or import the SDK in your project after setting the Base... value. I have not tried this method at an appropriate location in your .csproj file. ).

    Here is a link for customizing build that refers to some of these techniques:

    https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2019

提交回复
热议问题