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

Notification

Icon
Error

Unable to include other project XML documentation
michaellogutov
#1 Posted : Monday, September 19, 2016 9:37:34 AM(UTC)
Rank: Member

Groups: Registered
Joined: 2/2/2015(UTC)
Posts: 24
Location: Russia

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)
In my solution I have project A then references project B.
Project B generates comments XML file (B.xml).
Project A depends on that B.xml file and there is a check in code that ensures that this files present.

Not we have test project A.Tests that referencing A and tests the code which checks the existence of XML file.
If I run this test from withing Visual Studio runner it builds A.Tests, builds A, builds B and in A.Tests bin directory there are files: A.dll, B.dll, B.xml
All works fine - test passes.

Now when I'm using nCrunch I can't seems to find a way to include B.xml for it to be in the bin directory of A.Tests
I've added project B as implicit project dependencies for project A.Tests and added "..\B\bin\Debug\B.xml" as additional file for project A.Tests - I see it in the ncrunch work folder but it not copied to bin with A.Tests.dll

What should I do?
Remco
#2 Posted : Monday, September 19, 2016 11:43:08 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for posting!

This is technically a resource co-location assumption - see http://www.ncrunch.net/documentation/considerations-and-constraints_assembly-colocation-assumptions.

Using the 'Copy referenced assemblies to workspace' setting likely won't work here if the B.xml file is generated with a custom build step, as there is nothing telling NCrunch that it should be copied to the build output directories of referencing projects.

Adding B.xml as an additional file also won't work well, as this creates a dependency that exists outside your build system, making NCrunch dependent on your foreground build (which you really don't want).

There are two effective ways to solve this:
1. Engineer the test to copy B.xml from the build output directory of project A into the build output directory of project B.
2. Introduce an abstraction that allows your test to control how the B.xml file is resolved, so that it can override this logic and load the file from an alternative location.
michaellogutov
#3 Posted : Monday, September 19, 2016 1:04:34 PM(UTC)
Rank: Member

Groups: Registered
Joined: 2/2/2015(UTC)
Posts: 24
Location: Russia

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)
Actually this is an XML comments file it's generated as part of the build.
So setting "Copy referenced assemblies to workspace" to true fixed the problem :)

I've totally overlooked that setting.

Thanks!
1 user thanked michaellogutov for this useful post.
Remco on 9/19/2016(UTC)
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.025 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download