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

Notification

Icon
Error

VS 2022 "The msbuild command returned exit code 1" error
MrClyfar
#1 Posted : Tuesday, October 19, 2021 3:06:00 PM(UTC)
Rank: Member

Groups: Registered
Joined: 8/6/2011(UTC)
Posts: 17

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Hello.

I am uising the following:

Quote:
NCrunch version 4.10.0.6

Microsoft Visual Studio Enterprise 2022 RC
Version 17.0.0 RC
VisualStudio.17.Release/17.0.0+31808.319.rc
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Enterprise


Whilst NCrunch is building the various projects in the solution, I get the following error for two of the unit test projects...

Quote:
NCrunch was unable to resolve dependency data for its own assemblies under your chosen framework. It is possible that the version of NCrunch you are using does not have support for this framework, or otherwise there may be another problem present on your system. NCrunch will fall back to using pre-packaged dependency data which may or may not be compatible with your chosen framework. This may result in dependency resolution problems inside your test environments.

Details for this problem are below:

The msbuild command returned exit code 1: "c:\program files\microsoft visual studio\2022\enterprise\MSBuild\Current\Bin\msbuild.exe" /t:Restore nCrunch.Module.XUnit2.DotNetCore.csproj


I'm not certain what to do here. I checked whether the Live Unit Tests feature in VS is working, and that did indeed process all the tests without issue.

Is there some means of resolving this issue please?

Thanks.

EDIT:

I've just noticed that NCrunch does execute the tests, at first I thought it did not. But the above warning is still being outputted - not sure if it's a big issue.
Remco
#2 Posted : Wednesday, October 20, 2021 12:35:52 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Hi, thanks for sharing this issue.

For NCrunch to be able to execute tests on your system, its own code has dependencies on certain Nuget packages.

Because we don't include these packages in the installer, they need to be restored using an MSBuild step when NCrunch goes to set up its environment. To do this, we basically build a small .csproj file with references to the packages, then run a restore command. The restore step pulls down the packages and all is well.

Unfortunately, the command isn't 100% reliable. Sometimes it fails, probably due to differences in the environment. When this happens, you'll get a warning like this one, which usually will also show the names of the missing packages and their versions.

If your tests are running without problems, there's nothing you need to do here. Most likely you already have later versions of the same packages already installed and NCrunch is able to do fine with those.
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.124 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download