Build/Test Issues

"unable to resolve dependency data for NCrunch internal assemblies"

Started by rleahey on 3,095 views

I'm dealing with an NCrunch issue - I assure you that I would normally exhaust my online research before posting a question, but I'm in the tight spot of trying to sell my team/managers on the value of NCrunch and need to get this working before my Monday morning demo session.

Visual Studio 2019 (16.10.2)
xUnit 2.4.1
MoQ 4.16.1
NCrunch 4.8.0.3

This is a greenfield solution with multiple projects and I was tasked with getting unit testing up and running. I'm getting xUnit + MoQ projects set up in the solution, but my current NCrunch Test panel looks like

[img=https://drive.google.com/file/d/1ViodIJXgpYn7ksb5b7GgTcNvGLeP7GQ3/view?usp=sharing]Test Panel screenshot[/img]

The recurring issue is described a couple of ways but it looks like the main offense is "NCrunch was unable to restore Nuget packages required to build a test environment for this solution, due to an error: The msbuild command returned exit code 1: "c:\program files (x86)\microsoft visual studio\2019\professional\MSBuild\Current\Bin\msbuild.exe" /t:Restore "C:\<localpath>\Local\NCrunch\29200\PackageRestore\restorePackages.csproj"

I've examined the pages on NCrunch's own site that seem to deal with this, but I've not yet found a solution.
Given the urgency of getting this solved (so as to make NCrunch look good to my bosses) I thought I'd go ahead and ask for help here, so - HELP!
I just noticed NCrunch 4.9 is out. Downloading now...
Updating NCrunch to 4.9.0.8 didn't seem to change anything.

Also, I neglected to mention that these projects are all targeting .NET 5.
Hi, thanks for posting.

This problem is caused when something blocks MSBuild from restoring packages on your machine. This could be due to a firewall or virus scanner, or maybe something in your security settings. The good news is that it's fairly easy to work around it.

Usually the error contains a list of Nuget packages that are required on your machine but couldn't be found by NCrunch.

Create a new solution on your machine with a throw-away .NET Core project. In this project, create references to the versions of the Nuget packages listed in the error message, then let VS build the project. This will force a Nuget restore of the missing packages and hopefully allow NCrunch to work on this solution the next time you try it.
Thank you so much for your quick response. I had to do a bit of mucking about in Nuget, but all is now working correctly in time for my demo on Monday. I'm quite pleased. I love NCrunch.

Thanks again.
Creating new solution and referencing the missing Nuget packages worked for me. Thanks!

Visual Studio 2022 (17.3.6)
NCrunch (4.14.0.7)

Post a reply

Log in to reply.