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

Notification

Icon
Error

Custom nuget.config causing Nuget restore warning
VNicholson
#1 Posted : Sunday, August 18, 2019 9:51:36 PM(UTC)
Rank: Member

Groups: Registered
Joined: 12/19/2013(UTC)
Posts: 20
Location: New Zealand

Thanks: 5 times
Was thanked: 2 time(s) in 2 post(s)
I've noticed that having a globalPackagesFolder element explicitly configured in the nuget.config file of my repository causes the following error to be output by NCrunch.

Code:
Unable to restore required Nuget packages for .NET Core test environment.


Everything still seems to work okay, but can someone please confirm whether this error is spurious? Removing the explicit globalPackagesFolder configuration makes the warning go away, but for reasons beyond my control I need this configuration to be present. For reference, my nuget.config is reproduced below:

Code:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageRestore>
    <add key="enabled" value="true" />
  </packageRestore>
  <config>
    <add key="globalPackagesFolder" value="packages" />
    <add key="repositorypath" value="packages" />
  </config>
  <solution>
    <add key="disableSourceControlIntegration" value="true" />
  </solution>
</configuration>
Remco
#2 Posted : Monday, August 19, 2019 12:54:16 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 sharing this issue.

In your case, this error is probably more of a warning. It's being caused by an internal discrepancy between your redirected package path and the default global packages directory on your system. Essentially, NCrunch has tried to install several packages it suspects might be needed in your runtime environment to execute your tests. Its install system hasn't considered your redirection, but its background checks for the installed packages have .. so the error is kicked up.

You can choose to either ignore the error, or if you want the error to go away, you can make sure that the packages mentioned in the error are installed in your solution's packages directory. This can be done by either copying them in manually or by referencing the packages temporary from one of your projects to force VS to restore them.
VNicholson
#3 Posted : Monday, August 19, 2019 2:34:13 AM(UTC)
Rank: Member

Groups: Registered
Joined: 12/19/2013(UTC)
Posts: 20
Location: New Zealand

Thanks: 5 times
Was thanked: 2 time(s) in 2 post(s)
I'm happy to ignore the error if it's benign.

Are there plans to make NCrunch respect the nuget.config overrides so it installs dependencies to the specified globalPackagesFolder? Presumably that would also get rid of the spurious warning?
Remco
#4 Posted : Monday, August 19, 2019 4:14:30 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)
VNicholson;13777 wrote:

Are there plans to make NCrunch respect the nuget.config overrides so it installs dependencies to the specified globalPackagesFolder? Presumably that would also get rid of the spurious warning?


Yes, and yes :)
1 user thanked Remco for this useful post.
VNicholson on 8/19/2019(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.034 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download