VS2015 RC中的软件包管理器无法安装/还原一些软件包



我正在尝试将nuget软件包-ngenerics.1.4.1从nuget.org(https://www.nuget.org/packages/ngenerics/)安装到ASP中。净5项目(网站)。软件包管理器以urrimortrate Xsception失败。之后错误列表中添加了错误:"依赖关系ngenerics> = 1.4.1.0无法解决"。
我还尝试从本地文件夹注册表进行安装。

这是msconnect上的错误。

我想知道有人在Google中找不到任何东西。也欢迎任何解决方法。

软件包管理器的输出:

Installing NuGet package NGenerics.1.4.1.
Successfully installed 'NGenerics.1.4.1' to Samples.AjaxDemo2.
========== Finished ==========
Restoring packages for D:WorkAppsSamples.AjaxDemo2project.json
----------
System.UriFormatException: Invalid URI: The format of the URI could not be determined.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at System.Uri..ctor(String uriString)
   at Microsoft.Framework.PackageManager.PackageSourceUtils.CreatePackageFeed(PackageSource source, Boolean noCache, Boolean ignoreFailedSources, Reports reports)
   at Microsoft.Framework.PackageManager.RestoreCommand.AddRemoteProvidersFromSources(List`1 remoteProviders, List`1 effectiveSources)
   at Microsoft.Framework.PackageManager.RestoreCommand.<RestoreForProject>d__74.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.<>c__DisplayClass73_0.<<ExecuteCommand>b__0>d.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__73.MoveNext()
----------
Restore failed
Invalid URI: The format of the URI could not be determined.

我今天在2013年的Nuget 2.8.5偶然发现了同一问题。由于看来System.Uri必须能够解析它,因此您要做的就是确保相对路径是适当的合法URI。相对文件URIS必须以'./'开头(obv也不要使用后挡,它们是Windows的东西!)。请参阅C#类型处理相对和绝对URI和本地文件路径

例如。使用:

<add key="local-feed" value="./lib/nuget-feed" />

而不是:

<add key="local-feed" value="lib/nuget-feed" />

删除本地提要不是一个好主意,因为您现在必须从其他供稿中恢复,这可能不是您想要的(就个人而言,我不会在Nuget Gallery上打赌我的版本停机时间...)

最后,我发现了出了什么问题。我有" .nuget nuget.config"文件,我的解决方案的某处是文件夹结构。
nuget.config包含一个带有相对文件路径的软件包源:

<configuration>
  <packageSources>
    <add key="local" value="......Release"/>
  </packageSources>
</configuration>

当我删除VS中的PackagesOurce软件包管理器时,开始工作。

这有点荒谬。

希望它可以帮助某人不像我那样失去这么多小时。

在浪费了大约两个小时后,我发现我的软件包源被添加到.nuget nuget.config中的" disabledpackagesources"部分中。我只需要从禁用列表中删除它。

 <disabledPackageSources>
    <add key="RaNuget" value="true" />
  </disabledPackageSources>

最新更新