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

Notification

Icon
Error

Build Failure after latest upgrade
casnap
#1 Posted : Tuesday, July 23, 2013 6:32:19 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/23/2013(UTC)
Posts: 2
Location: United States of America

NCrunch for VS 2012 v1.46.0.20

Immediately after upgrading two new messages appear, neither of which were displayed by the previous version.

The first is "Fusion logging is enabled and is impacting performance". Near as I can tell, Fusion logging is not enabled. The viewer is empty and the registry entry to enable it is disabled: Set-ItemProperty HKLM:\SOFTWARE\Microsoft\Fusion EnableLog 0

This is a warning I can ignore, so life would be confusing but productive were it just this.

The real problem is ccrewrite is now exiting with an error, but only for NCrunch? Here's the output:
Code:
ccrewrite (0)#0: Rewrite aborted due to metadata errors. Check output window
..\..\..\..\..\..\..\..\..\..\Program Files (x86)\Microsoft\Contracts\MsBuild\v4.0\Microsoft.CodeContracts.targets (250)#1: The command ""C:\Program Files (x86)\Microsoft\Contracts\Bin\ccrewrite.exe" "@ClientGateway.Hostccrewrite.rsp"" exited with code -1.


This is the Build Output for the same in VS:
Code:
8>CodeContractRewrite:
8>  "C:\Program Files (x86)\Microsoft\Contracts\Bin\ccrewrite.exe" "@ClientGateway.Hostccrewrite.rsp"
8>  elapsed time: 583.0078ms


There is nothing in Output for the "NCrunch Diagnostic Output".

The referenced project here is the last in the build order. Several others before it also use Code Contracts. In all cases CONTRACTS_FULL is defined.


Remco
#2 Posted : Tuesday, July 23, 2013 8:08:46 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,981

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for posting.

It looks as though the zero value in the 'EnableLog' is triggering the NCrunch warning. Currently NCrunch incorrectly assumes a non-null value to indicate that logging is enabled. I've noted this down for a fix. You can either ignore the warning or remove the registry value to work around this.

The ccrewrite issue is, as you've described, more disturbing. Can you try the following?

- Turn off the 'Instrument output assembly' setting for ALL the projects in your solution
- Turn on the 'Copy referenced assemblies to workspace' setting for ALL the projects in your solution

... Does this have any impact on the ccrewrite build issue? This will help to narrow down whether the issue is being caused by NCrunch's instrumentation or build optimisations. If this doesn't make any difference (i.e. the error still appears), try the following:

1. Right click on the failed build in the Tests Window
2. Choose Advanced->Browse to workspace
3. Find the .proj file inside the workspace
4. Open a command prompt to this location
5. Try executing MSBuild against the .proj file directly using default options on the command line (i.e. "msbuild myproject.csproj"). You may need to map a path for MSBuild to your .NET directory for this (i.e. C:\Windows\Microsoft.NET\Framework64\v4.0.30319)
6. Does the build throw the same error as NCrunch?
casnap
#3 Posted : Thursday, July 25, 2013 2:11:25 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/23/2013(UTC)
Posts: 2
Location: United States of America

I was able to get NCrunch to build the entire solution and run tests by turning off "instrument output assembly" for all project and turning on "copy referenced assemblies to workspace".

I then proceeded to turn OFF "copy reference assemblies to workspace" for each project one-by-one, until it broke. The error reference above when building ClientGateway.Host goes away when ONLY its dependency, ClientGateway, has "copy referenced assemblies to workspace" set to ON.

After this, I turned "instrument output assembly" for all projects back on, and it continued working (again with "copy referenced assemblies to workspace" on for ClientGateway). This state of affairs leaves me with two warnings: one about the copying setting and the other "abnormal runtime assembly reference resolution detected". Not an ideal state of affairs considering, but workable.

Is there a quick downgrade option for NCrunch? is there any other information I can provide to help identify a fix?

Remco
#4 Posted : Thursday, July 25, 2013 4:36:05 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,981

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
As far as I'm aware, 1.46 doesn't contain any changes that should introduce this shift in behaviour. The ccrewrite exception seems to be caused by the rewriter making use of dependent assemblies that it assumes are in the same directory as the assembly being built, in which case turning on the 'Copy referenced assemblies to output' setting is the correct answer to this problem (and is likely to be the only way to solve it).

The warning about abnormal runtime referencing is safe to ignore as long as you're not experiencing crazy things going on in your testing environment (i.e. runtime reference resolution errors etc). The purpose of this warning exists more to draw attention to a configuration setting that can be used to solve such problems if they appear - so basically, don't worry about this one.

Because of the way ccrewrite works, my theory is that there has been a change made to your codebase that introduced a contract dependency between these assemblies around the same time as you upgraded to 1.46. The download for the 1.45 MSI is still available (and it will work forever), so you're very welcome to try reinstalling 1.45 to see if this will solve the problem. The 1.45 installer should just wipe straight over the top of 1.46 (automatically removing it).
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.035 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download