Quantcast
Channel: MSBuild forum
Viewing all articles
Browse latest Browse all 2763

Changing IntermediateOutputPath breaks C# compilation (MSB3491)

$
0
0
I'm attempting to consolidate the intermediate outputs of building a Visual Studio 2015 solution to a single directory within my output directory. The solution contains a C# class library (among other projects).

In order to do this, the library project imports "common.proj", which defines the following:
<BaseIntermediateOutputPath>$(OutputPath)OBJ\</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(MSBuildProjectName)\</IntermediateOutputPath>

Prior to defining these values, the project compiled successfully. For the sake of clarity, $(OutputPath) is also defined in common.proj, and seems to be fine (i.e. when the build succeeds, it contains the expected outputs).

After defining the values, compilation fails with the message:
error MSB3491: 
Could not write lines to file "obj\x86\Release\\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B1_BC5D3.cs". 
Could not find part of the path 'C:\Data\Repositories\Code\[Subsystem]\[subgroup]\[projectname]\src\obj\x86\Release\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B1-BC5D3.cs'.

I understand why the build process can't write to the file - the obj directory no longer resides under the project's src directory, so that's fair enough. What I don't understand is why it's trying to write to the file in that location, given I have changed base and intermediate output file locations.

I've missed something, but my googling hasn't pulled up anything particularly useful - any suggestions would be good.




Viewing all articles
Browse latest Browse all 2763

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>