Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

IProjectGlobalPropertiesProvider
JayBazuzi
#1 Posted : Thursday, December 19, 2013 11:48:07 PM(UTC)
Rank: Member

Groups: Registered
Joined: 12/19/2013(UTC)
Posts: 10
Location: United States of America

Was thanked: 1 time(s) in 1 post(s)
We have an extension for Visual Studio 2013 that uses IProjectGlobalPropertiesProvider + ProjectCollection.GlobalProjectCollection.SetGlobalProperty() to set some properties that are then consumed by the projects we want to build. This causes NCrunch to fail to build our projects.

For example, the extension includes a special .targets file, and then our projects have

<Import>$(MyExtensionDirectory)\MyCustom.Targets</Import>

Is there something special we should do to help NCrunch see these properties? Or should NCrunch recognize these custom properties?
Remco
#2 Posted : Friday, December 20, 2013 2:01:18 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi, thanks for posting!

Can you share any information about when these properties are set within the MSBuild life cycle? Is this being handled by a custom built MSBuild task?

Something that often needs to be done with NCrunch is to include MSBuild task .dlls using the Additional files to include configuration setting. Sometimes NCrunch doesn't automatically detect the build task files and they need to be explicitly included to be copied to the NCrunch workspaces.
JayBazuzi
#3 Posted : Friday, December 20, 2013 2:45:44 AM(UTC)
Rank: Member

Groups: Registered
Joined: 12/19/2013(UTC)
Posts: 10
Location: United States of America

Was thanked: 1 time(s) in 1 post(s)
It's handled by our package, when the package is loaded in to Visual Studio. It looks like we call ProjectCollection.GlobalProjectCollection.SetGlobalProperty("MyExtensionDirectory", ...) at that point. I wish I could hand you a simple, complete repro example; sorry!

I don't believe it's an issue with "Additional files to include". I found that if I hand-edit a project to add:

<PropertyGroup>
<MyExtensionDirectory>...</MyExtensionDirectory>
<PropertyGroup>

then NCrunch successfully builds & run tests, which is why I draw this conclusion.
Remco
#4 Posted : Friday, December 20, 2013 5:07:39 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Ahh - I understand. So you have a custom VS package that modifies the project properties in the IDE memory.

I'm afraid there's no way that NCrunch will be able to pick up such a property. NCrunch integrates with MSBuild, running it in processes spawned outside the IDE. In a similar way to what you've described, you may be able to work around this by introducing a conditional property group into the projects that require this, i.e:

<PropertyGroup Condition="$(NCrunch) == '1'"/>
<MyExtensionDirectory>$(ProjectDir)MyTempExtensionDir</MyExtensionDirectory>
</PropertyGroup>
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.029 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download