太长的路径异常引发到特定版本的包

时间:2016-11-12 03:29:38

标签: nuget nuget-package nuget-package-restore

我在Azure免费应用服务上构建了我的私有Nuget存储库。 我将网址添加到Visual Studio 2015中。

有一个包有三个版本1.0.3~1.0.5。

问题是只有1.0.3版本的软件包才能成功安装。 其他因为异常(路径或文件名太长)而总是失败。

我不知道他们为什么会给我不同的结果。

非设置不同。 我还将项目文件夹放在D:drive的根目录上。

请查看日志并告诉我原因:D

Attempting to gather dependency information for package 'GEPAEntities.1.0.5' with respect to project 'TestApps\EntitiesTestConsole', targeting '.NETFramework,Version=v4.0'
Gathering dependency information took 52.53 ms
Attempting to resolve dependencies for package 'GEPAEntities.1.0.5' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'GEPAEntities.1.0.5'
Resolved actions to install package 'GEPAEntities.1.0.5'
Retrieving package 'GEPAEntities 1.0.5' from 'P-ful, Inc.'.
  GET http://pfulnugetserver.azurewebsites.net/api/v2/package/gepaentities/1.0.5
  OK http://pfulnugetserver.azurewebsites.net/api/v2/package/gepaentities/1.0.5 63ms
Installing GEPAEntities 1.0.5.
Error downloading 'GEPAEntities.1.0.5' from 'http://pfulnugetserver.azurewebsites.net/api/v2/package/gepaentities/1.0.5'.
The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
Install failed. Rolling back...
Package 'GEPAEntities.1.0.5' does not exist in project 'EntitiesTestConsole'
Package 'GEPAEntities.1.0.5' does not exist in folder 'D:\GEPAClient\packages'
Executing nuget actions took 803.27 ms
Error downloading 'GEPAEntities.1.0.5' from 'http://pfulnugetserver.azurewebsites.net/api/v2/package/gepaentities/1.0.5'.
  The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
========== Finished ==========
Time Elapsed: 00:00:03.2133955

1 个答案:

答案 0 :(得分:0)

我不确定,但我解决了我的问题。

我刚刚将支持的框架版本添加到nuspec文件中。

  <dependencies>
    <group targetFramework=".NETFramework4.5" >
        ...
    </group>
    <group targetFramework=".NETFramework4.0" >
        ...
    </group>          
</dependencies>

无论如何,它是我预期的工作。