aspnet / dnx

OBSOLETE - see readme
Other
963 stars 224 forks source link

The kpm restore failed if you have private NuGet package source #1274

Closed colotiline closed 9 years ago

colotiline commented 9 years ago

Problem When I use kpm restore it's failed with the network path was not found exception.

Reason I've got 2 private NuGet package sources. One is AppVeyor (required credentials) and one is my job's repository that is accessible only through VPN. kpm can't use them.

Current solution (very bad) Remove these package sources.

Better solution kpm restore should skip locations that it can't find.

BrennanConroy commented 9 years ago

Have you tried --ignore-failed-sources?

colotiline commented 9 years ago

No. Thanks. Will try in this evening (GMT+3).

Why is --ignore-failed-sources not default?

davidfowl commented 9 years ago

Because we decided that it's not great behavior. You want to know when the sources you configured aren't effective. We're looking at changing nuget.config altogether though. Global config hierarchy of sources will likely go away as it causes too many issues in real scenarios.

Your global sources should not be inherited into every project by default.

colotiline commented 9 years ago

Using kpm restore --ignore-failed-sources didn't help.

I've got the same exception for my job's repository. Its uri is \\192.168.1.35\Packages. VPN connection state doesn't matter.

So it looks like kpm doesn't support shared folders as NuGet packages source. Am I right? If yes, will it support them in the future?

Full exception:

Restoring packages for c:\Repositories\VisualStudio\Test\Solution\Client\Web\Client\project.json
----------
System.IO.IOException: The network path was not found.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.Directory.EnumerateFiles(String path, String searchPattern)
   at Microsoft.Framework.PackageManager.PackageFolderFactory.<>c__DisplayClass1.<CreatePackageFolderFromPath>b__2(String dir)
   at Microsoft.Framework.PackageManager.PackageFolderFactory.CreatePackageFolderFromPath(String path, IReport report)
   at Microsoft.Framework.PackageManager.RestoreCommand.AddRemoteProvidersFromSources(List`1 remoteProviders, List`1 effectiveSources)
   at Microsoft.Framework.PackageManager.RestoreCommand.<RestoreForProject>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Framework.PackageManager.RestoreCommand.<ExecuteCommand>d__1.MoveNext()
----------
Restore failed
The network path was not found.
colotiline commented 9 years ago

I cloned the repository. kpm should support shared folders (class 'PackageSourceUtils, methodCreatePackageFeed`). But I always get the exception above. I will setup an environment for the XRE and try to debug later.

davidfowl commented 9 years ago

Dupe of https://github.com/aspnet/XRE/issues/1274

colotiline commented 9 years ago

@davidfowl, English is not my main language. What does "dupe" mean? I can't understand the reason for closing this issue.

colotiline commented 9 years ago

@davidfowl, sorry for being annoying. If dupe means duplicate I suppose you should change related issue number. Because now issue #1274 was closed as duplicate of issue #1274.

davidfowl commented 9 years ago

Wrong bug number https://github.com/aspnet/XRE/issues/1271