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

Notification

Icon
Error

How to make .nuproj projects work with NCrunch
fabiostrocco
#1 Posted : Tuesday, September 4, 2018 9:15:22 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/4/2018(UTC)
Posts: 1
Location: Denmark

I have a solution with two nuproj projects, say A and B. Both projects contain only props and targets files (so NO assemblies or PDB files) and they both generate NuGet packages.

Now, A has no reference and it is an internal dependency, whereas B references A plus other external NuGets. Then I have an MSTest project that dynamically invokes MSBuild on a project which references B.

All works fine in Visual Studio and the tests pass. However, NCrunch compiles with warnings for the project B.

WARNING - ........\program files (x86)\microsoft visual studio\2017\professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets (2110, 5): MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not load file or assembly 'A.nupckg' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Infact, no NuGet package is generated for the A project in the NCrunch solution directory (the package is correctly generated in Visual Studio).

I have also tried to set the following properties for the A and B projects:

Instrument assembly = false
Prevent signing of output assembly = false
Implicit project dependencies = true
nothing changes and the warning is still there and no NuGet is generated for the A project (all the source files and dependent assemblies are in the NCrunch solution folder). And Copy referenced assemblies to workspace is set to true.

Is there any known issue with using NCrunch with .nuproj?
Remco
#2 Posted : Tuesday, September 4, 2018 9:42:15 AM(UTC)
Rank: NCrunch Developer

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

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

At present, no formal testing has been performed with NCrunch on .nuproj projects. No specialised code has been written to handle them, and no analysis has been done. To be honest, my own experience with these project types is pretty close to zero.

So I think it's safe to say that this is an unsupported project type. Any success you have in using NCrunch with it is entirely accidental and due to the abstractions involved. We really can't warrant that it will work at all.

If you'd like to see support extended to this area you're most welcome to vote for it on uservoice.

Meanwhile, I would suggest turning off these projects under NCrunch using the 'Ignore this project completely' setting. If they contain code that you need to target using your tests, I'd suggest moving this code out to a separate project (a non .nuproj one) and accessing it through a project reference. In this way, you can target the code using normal test projects and still use the .nuproj for generating your packages for deployment.
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