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

Notification

Icon
Error

Project failing to build - where to find the errors?
m.e.
#1 Posted : Tuesday, May 15, 2012 10:38:24 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/15/2012(UTC)
Posts: 2

I've just tried to add NCrunch to an existing solution. The solution msbuild projects are somewhat customized, so I did not expect it to work right away. As expected, NCrunch reports that projects are 'failing to build'

But I don't see any actual build error message text anywhere - just notification about the error, but not details - the Output/Build and Output/'NCrunch Output' windows are empty.

Is there any other place to see the build error messages? It is kind of hard to troubleshoot them blindly.
Remco
#2 Posted : Wednesday, May 16, 2012 12:34:13 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Most build errors should be shown in the Tests Window. As you have a customised build, it's possible that the build is failing due to an NCrunch internal problem of some kind - in which case you should have a look in the processing queue instead, which gives a much more physical output from the build process. It's often worth setting the logging to a more detailed verbosity in your NCrunch global configuration, as this will allow the failed task in the processing queue to show more information. It would be great if you can share the error message here so I can help with understanding it and further improving the error reporting with future versions.
m.e.
#3 Posted : Wednesday, May 16, 2012 12:50:53 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/15/2012(UTC)
Posts: 2

Tanks - the processing queue is useful, missed it before.

Here is the exception:

[17:45:30.1262-BuildTask-11] ERROR (Internal): System.InvalidOperationException: Cannot modify an evaluated object originating in an imported file "...\Microsoft.Common.Before.targets".

Server stack trace:
at Microsoft.Build.Shared.ErrorUtilities.ThrowInvalidOperation(String resourceName, Object[] args)
at Microsoft.Build.Shared.ErrorUtilities.VerifyThrowInvalidOperation(Boolean condition, String resourceName, Object arg0)
at Microsoft.Build.Evaluation.Project.VerifyThrowInvalidOperationNotImported(ProjectRootElement otherXml)
at Microsoft.Build.Evaluation.Project.RemoveItemHelper(ProjectItem item)
at Microsoft.Build.Evaluation.Project.RemoveItem(ProjectItem item)
at nCrunch.VSIntegration2010.MSBuildIntegration.BuildableProject.RemoveItems(String itemName)
at nCrunch.Compiler.RemoteBuildRunner.Build(ComponentBuildParameters parameters)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

It seems to be related to a line in the .csproj
<Import Project="$(EnvironmentConfig)" />
where EnvironmentConfig is environment variable that points to shared config - all our projects start with this line.
If I avoid this line in NCrunch build, the build proceeds further (but fails with another error - now reported in Tests Window).
Remco
#4 Posted : Wednesday, May 16, 2012 12:58:40 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
This makes good sense. Usually where I've seen this problem it relates to included build files that specify their own <ProjectReference> or <AssemblyReference> tags. NCrunch needs to manipulate/remove these tags in order to control the assembly references used during the build process.

I have an item in my backlog to improve the error reporting around this so that people can better understand why these sorts of things happen. Unfortunately because the error is caused by what can be quite a complex piece of build customisation, I've yet to find a clean way to actually solve the problem within NCrunch. My recommendation is to remove any <ProjectReference> or <AssemblyReference> declarations from the included build file and instead move these to your own project file. If you're uncomfortable with making this change for non-NCrunch builds, you can use the NCrunch build environment variable $(NCrunch) == '1' to implement conditional logic inside your build process.


Cheers,

Remco
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.040 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download