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
So you can override those settings, if needed. If your import came before, Visual Studio's properties would take precedence. In MSBuild, the last definition wins and is used. This is a good thing. Is it causing errors? Or do you just not like it?
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
Those IntermediateOutputPath's can be inserted when MSBuild is given a bad path.
In our case, we had extra unnecessary slash after SolutionDir for output folders.
What wasn't working for us(note the extra slash):
<OutputPath>$(SolutionDir)\out\bin\</OutputPath>
<IntermediateOutputPath>$(SolutionDir)\out\obj\</IntermediateOutputPath>
What did work:
<OutputPath>$(SolutionDir)out\bin</OutputPath>
<IntermediateOutputPath>$(SolutionDir)out\obj</IntermediateOutputPath>
To help troubleshoot your particular case, try turning on diagnostic MSBuild output and logging under Tools->Options->Projects and Solutions->Build and Run-> MSBuild project build output verbosity. Then, search for the generated folder (ex. "Temp").
Using common proj/props/targets file is a great idea, but it does require fighting Visual Studio a little.
You have specified the in your project. The Property file will have the BaseIntermediateOutputPath. If you don't specify any value in it will be derived from your Base.
The full intermediate output path as derived from BaseIntermediateOutputPath, if no path is specified. For example, \obj\debug. If this property is overridden, then setting BaseIntermediateOutputPath has no effect.
Refer: http://msdn.microsoft.com/en-us/library/bb629394.aspx