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

Notification

Icon
Error

CopyReferencedAssembliesToWorkspace
greba
#1 Posted : Friday, January 27, 2012 2:48:23 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/27/2012(UTC)
Posts: 13

Was thanked: 3 time(s) in 3 post(s)
I have a solution with sixty projects that with CopyReferencedAssembliesToWorkspace set to false will compile a fair number of the projects successfully but will fail for certain projects. When I set CopyReferencedAssembliesToWorkspace to true nearly all of the projects will compile successfully. I'd like to get that issue resolved but I'd like to focus on the first issue.

The first error NCrunch gives me when I have CopyReferencedAssembliesToWorkspace set to false is a Test project can't find a reference to an assembly. Yet that reference is one of the projects that NCrunch built successfully.

Is there something in my solution that NCrunch isn't liking that I could change (and how do I figure out what to change)?

Or is this a problem with NCrunch as the solution builds fine in Visual Studio?

I've read the https://www.ncrunch.net/...ng_project-build-issues but I'm not understanding what steps I can take to try and resolve this issue.
Remco
#2 Posted : Sunday, January 29, 2012 12:31:24 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)
The CopyReferencedAssembliesToWorkspace is considered to be a workaround for dealing with abnormal situations - such as custom build steps or interesting tests. Normally you shouldn't need to use it. I'd like to have a look at the NCrunch log file after it's tried to build your solution with this setting turned off. Would you be able to submit a bug report after switching it off and hitting the reset button?
greba
#6 Posted : Wednesday, February 1, 2012 1:52:55 AM(UTC)
Rank: Member

Groups: Registered
Joined: 1/27/2012(UTC)
Posts: 13

Was thanked: 3 time(s) in 3 post(s)
What is included in the bug report? I'd like to go over it before submitting it to see if I need to sanitize it.
Remco
#7 Posted : Wednesday, February 1, 2012 3:45:55 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)
The bug report contains a log file that shows the workings of the NCrunch engine up to the point where the report was submitted. To see what the log file contains, try turning on the 'Log to output window' setting in your configuration, then set the 'Log verbosity' to 'Detailed'. You'll start to see a whole lot of log text appearing in the NCrunch output window. Essentially the log file contains the same text, so if you need to sanitise it then you should just be able to to a copy/paste of this text into a separate file, make your modifications, and I'll give you an email address to send it to.
greba
#8 Posted : Wednesday, February 1, 2012 3:18:01 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/27/2012(UTC)
Posts: 13

Was thanked: 3 time(s) in 3 post(s)
I'll take a look at that and see what it contains and see if I can send it out.

I was able to narrow the problem down to two specific files in the failing test project. The test project included an accessor:
<Shadow Include="Test References\OtherProject.accessor" />

When I changed the shadow to none it stopped giving me the reference error. I haven't looked up what this shadow versus none means, any ideas?

Visual Studio and Ncrunch then both gave compilation errors about a test that were using the accessor. After commenting out those tests I was able to get Visual Studio and Ncrunch to work on that test project.
greba
#9 Posted : Wednesday, February 1, 2012 8:23:02 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/27/2012(UTC)
Posts: 13

Was thanked: 3 time(s) in 3 post(s)
I was able to reproduce the problem in a new solution and I have submitted a bug report on it.
Remco
#10 Posted : Wednesday, February 1, 2012 9:17:57 PM(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)
Thanks, I've looked into this in detail and it makes sense to me now.

The MSTest accessors that are used to access private methods work by generating a new assembly in order to access them. This isn't a problem when all assemblies exist in the same directory (such as when the copy referenced assemblies setting is turned on), but the step fails if the assemblies exist in different areas of the disk.

Unfortunately there isn't much I can do to make this work without using the copy referenced assemblies setting. Microsoft never designed this feature to work with the default way NCrunch handles its builds. I recommend avoiding test accessors where possible, otherwise the copy referenced assemblies to workspace setting is an unfortunate necessity.

I'll make a note to add some auto configuration to a future version of NCrunch so that the copy referenced assemblies setting is turned on automatically when test accessors are detected - at the very least, this should make the configuration more intuitive.

Thanks again for reporting this problem.
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.042 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download