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

Notification

Icon
Error

NCrunch was unable to restore Nuget packages required to build a test environment for this project
soadyp
#1 Posted : Friday, June 15, 2018 11:01:46 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/14/2018(UTC)
Posts: 4
Location: Australia

NCrunch was unable to restore Nuget packages required to build a test environment for this project, due to an unspecified failure when invoking 'msbuild.exe /t:restore'

The following packages do not exist under the Nuget packages folder for the active user profile, yet they have been flagged by NCrunch as potentially needed for normal operation. NCrunch has attempted to restore these files via an MSBuild restore step, which has either failed or not returned the expected result. It's possible that these packages may not be needed for building projects or running tests in your environment. If you experience downstream problems with NCrunch on this solution, it is recommended you restore or download the packages manually.


Is there a way to tell NCrunch where Nuget Packages are?
What does Ncrunch think "Nuget packages folder for the active user profile" is ? Where does it get that info from ?

I have tried setting the documented nuget environment variables.
NUGET_HTTP_CACHE_PATH=the location
NUGET_PACKAGES=the location

There is a nuget.config files at Machine level.
C:\Program Files (x86)\NuGet\Config\Nuget.config
and
C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
both have the same content
<add key="Microsoft Visual Studio Offline Packages" value="the location"/>


There is a maintained file at user level
C:\Users\<user>\AppData\Roaming\NuGet\nuget.config
with
<config>
<add key="repositoryPath" value="the location" />
</config>

There are no project or solution level nuget package settings.

So Ncrunch should be able to find the packages.

Can I see why Ncrunch cant find packes or tell it which directories to use ?

EDIT: AFTER POSTING THIS, IT now works
not sure if was permissions on directories, an extra restart of VS or Ncrunch engine.

But I can now see Ncrunch working.
Sorry for any inconvenience
soadyp
#2 Posted : Friday, June 15, 2018 11:12:16 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/14/2018(UTC)
Posts: 4
Location: Australia

is there a close ticket option. ? If so feel free to close. I just couldnt see it.
Remco
#3 Posted : Saturday, June 16, 2018 12:51:06 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
soadyp;12342 wrote:
is there a close ticket option. ? If so feel free to close. I just couldnt see it.


I'm glad you managed to solve this. For a bit of background, this is a step NCrunch does to restore packages that it needs internally if it can't find the packages already installed in your user's .nuget directory. The package restore step is dependent on operation of a whole lot of stuff under the hood (MSBuild, .NET Core, Nuget, network, etc), so there are situations it can fail.

If you see this again, try creating a simple project that references the missing packages in Visual Studio. This will trigger VS to restore them to your user profile where NCrunch can find them.
1 user thanked Remco for this useful post.
David Arno on 10/14/2021(UTC)
Paramethod
#4 Posted : Tuesday, August 13, 2024 12:26:57 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/28/2021(UTC)
Posts: 10
Location: Canada

Thanks: 5 times
Was thanked: 3 time(s) in 3 post(s)
Not too sure where to write this, but I had a very similar error (NCrunch was unable to restore Nuget packages required to build a test environment for this solution) in Ncrunch for Rider v5.9.0.1. The solution that worked for me was to exit Rider, delete the `C:\Users\<UserName\AppData\Local\NCrunch\<SomeInt>` folder and restart Rider.
1 user thanked Paramethod for this useful post.
Remco on 8/13/2024(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.043 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download