安装Nuget软件包错误“路径不是合法形式"; [英] Install Nuget Package error "The path is not of a legal form"

查看:300
本文介绍了安装Nuget软件包错误“路径不是合法形式";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试安装NuGet软件包 RestSharp 时,出现错误The path is not of a legal form,并且未安装该软件包.

When trying to install the NuGet Package RestSharp I get the error The path is not of a legal form and the package is not installed.

使用Install-Package RestSharp从控制台进行安装时,会有很多以下消息:

When installing from the console using Install-Package RestSharp, there are a lot of the following messages:

项目 C:\ Users \ myName \ Source \ Workspaces \ Project \ Solution \ packages \ RestSharp.105.1.0 \ lib \ net35 \ RestSharp.dll 在您的工作区中找不到,或者您没有权限 访问它.

The item C:\Users\myName\Source\Workspaces\Project\Solution\packages\RestSharp.105.1.0\lib\net35\RestSharp.dll could not be found in your workspace, or you do not have permission to access it.

这种情况发生在新发布的Visual Studio 2015(社区版)中.

This happens with the newly released Visual Studio 2015 (community edition).

推荐答案

编辑:如果您有NuGet 3.0,那就是问题所在.只需更新NuGet,一切都会正常.以下步骤适用于NuGet 3.0,这很痛苦且容易出错.不要经历这种痛苦,选择简单的步骤,更新您的Nuget!

If you have NuGet 3.0, then that's the problem. Just update NuGet and everything should work. The steps below apply to NuGet 3.0, which are painful and error prone. Don't go through such pain, choose the easy step, update your Nuget!

我更新到VS Express 2015,从那时起,我经历了一些冒险.

I updated to VS Express 2015 and since then i've been through some adventures.

TL; DR 如果您禁用" TFS(源代码控制),则应该能够安装该软件包.然后再次将解决方案添加到源代码管理中,但这给我带来了很多问题.

TL;DR if you "disable" TFS (source control), you should be able to install the package. Then add the solution to source control again, but it caused me tons of problems.

所以...

我看到您有TFS.我也有.

I see you have TFS. I have it too.

此外,我看到您收到与我相同的错误消息.

Also, I see you are getting the same error messages as me.

我试图安装LanguageExt(C#6的一个很棒的库),当它尝试安装其依赖项之一(System.Collections.Immutable)时,它失败了.

I tried to install LanguageExt (an awesome library for C# 6) and it failed when it tried to install one of its dependencies (System.Collections.Immutable).

如果您想了解所有这些内容,请备份您的项目文件夹.

If you want to go through all this things, please make a backup of your project folder.

这就是我所做的:

1-将我的解决方案文件夹复制到其他地方.

1 - Copied my solution folder to somewhere else.

2-打开解决方案. VS聪明地要求我将其添加到源代码管理中,但我不想这样做.

2 - Opened the solution. VS smartly asked me to add it to source control, but I didn't want to.

3-尝试使用Install-Package LanguageExt

4-意外的成功

5-好吧,让我再次将其添加到TFS源代码管理中"

5 - "Fine, let me just add it to the TFS source control again"

从这里开始我的旅程.

由于我对TFS的经验很少,所以出现了成千上万的冲突,文件消失并再次出现等等.

Since I have little experience with TFS, I got thousands and thousands of conflicts, files vanishing and appearing again, etc.

但是经过一些工作,我开始运行它.

But after some work, I got it running.

这是值得的.

但是解决方案并不大,所以很容易.

But the solution isn't large, so, it was easy.

这篇关于安装Nuget软件包错误“路径不是合法形式";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆