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?
Build/Test Issues
How to make .nuproj projects work with NCrunch
Started by fabiostrocco on 2,897 views
Remco NCrunch Developer
#12618
04 Sep 2018 09:42 UTC
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.
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.
Post a reply
Log in to reply.