I have a new-style csproj
project file that overrides IntermediateOutputPath
. It looks like this:
<PropertyGroup>
<TargetFramework>netstandard1.6</TargetFramework>
<IntermediateOutputPath>new\path\to\obj</IntermediateOutputPath>
</PropertyGroup>
The problem is, my Visual Studio extension can't access IntermediateOutputPath
property. Project.Properties
seems to have much less stuff compared to old project format.
I've also tried project.ConfigurationManager.ActiveConfiguration.Properties
with the similar success.
Is there any way to get this information from Visual Studio extension?
So I created a simple extension to print all the properties
And this gave below output
In the CS project I had added
As you can see
IntermediateOutputPath
is coming up asIntermediatePath
. So you can useEdit-1 - .NET standard project
Edit-2 - 12-Aug-2017
So after digging more into the issue I found out the property is a MSBuild property as such and not a CSProject related property. That is why you don't see it in the Properties attribute. This requires a bit different direction to get the value using
IVsBuildPropertyStorage.GetPropertyValue
And then later use these methods to get the value
And this gives me the correct value of the property