无法摆脱NuGet官方包源
我进入包管理器 -> Package Sources 选项并删除 NuGet 官方包源,以便只有我的本地源可用。然后我关闭了 Visual Studio 2010。当我重新打开 Visual Studio 时,NuGet 官方包源仍然位于可用包源的顶部。 https://go.microsoft.com/fwlink/?LinkID=206669
我有尝试导出和导入设置,删除相关suo文件,但无济于事。即使我不打开解决方案也会发生这种情况。
我发现的一件事是,当我第二次打开 VS 时,以下配置文件是正确的。 C:\Documents and Settings{myusername}\Application Data\NuGet\NuGet.Config
一旦我在工具 -> 下打开包管理器,选项,官方源代码被添加到 NuGet.Config 中,因此,
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Local Package Source"
value="http://nuget:8081/DataServices/Packages.svc/" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration
更改为...
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!-- new line below -->
<add key="NuGet official package source"
value="https://go.microsoft.com/fwlink/?LinkID=206669" />
<add key="Local Package Source"
value="http://nuget:8081/DataServices/Packages.svc/" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration
当“选项”对话框打开时,即当我单击“选项”树视图中的“包管理器”时,该文件不会更改。
它从哪里获取此设置以及为什么不断插入它?
从 Ben Phegan 复制的有关 CodePlex 上同一问题的更新
http://nuget.codeplex。 com/workitem/1696
“我认为这可能是这里 AddOfficialPackageSourceIfNeeded() 的实现的问题”... http://nuget.codeplex.com/SourceControl/changeset/view/2b36b2e1935a#src%2fVisualStudio%2fPackageSource%2fVSPackageSourceProvider.cs
I go into the Package Manager -> Package Sources options and remove the NuGet official package source so that only my local source is available. Then I close visual studio 2010. As soon as I re-open Visual Studio, the NuGet official package source is still at the top of Available Package Sources. https://go.microsoft.com/fwlink/?LinkID=206669
I have tried exporting and importing settings, deleting relevant suo files to no avail. This happens even when I don't open a solution.
One thing that I have found is that when I open VS the second time, the following config file is correct. C:\Documents and Settings{myusername}\Application Data\NuGet\NuGet.Config
As soon as I open the Package Manager under Tools -> Options, the official source gets added to NuGet.Config so,
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Local Package Source"
value="http://nuget:8081/DataServices/Packages.svc/" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration
Is changed to...
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!-- new line below -->
<add key="NuGet official package source"
value="https://go.microsoft.com/fwlink/?LinkID=206669" />
<add key="Local Package Source"
value="http://nuget:8081/DataServices/Packages.svc/" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration
This file doesn't get changed when the Options dialog opens, just when I click on the Package Manager in the Options tree view.
Where is it getting this setting from and why does it keep inserting it?
Update copied from Ben Phegan on same issue on CodePlex
http://nuget.codeplex.com/workitem/1696
"I think this might be an issue with the implementation of AddOfficialPackageSourceIfNeeded() here"...
http://nuget.codeplex.com/SourceControl/changeset/view/2b36b2e1935a#src%2fVisualStudio%2fPackageSource%2fVSPackageSourceProvider.cs
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NuGet vsix 本身中有一些代码,如果列表中没有其他内容,则会添加默认反馈,但其中似乎存在一个错误:
这会失败,并将官方提要添加为第一个源。我会添加另一个源,以便您有 >1 个源(本地目录应该可以工作)。这应该可以防止这种行为。
Nuget.exe 命令具有类似的行为,但是无论可用的源如何,它都会默认添加。
我相信这种行为确实因版本而异。您使用什么版本?
There is some code within the NuGet vsix itself that adds the default feed back if there are no others in the list, but it appears that there is a bug in it:
This then falls through and adds the official feed as the first source. I would add another source so that you have >1 source (a local directory should work). This should prevent this behaviour.
The Nuget.exe command has similar behaviour, however it is added by default regardless of the sources available.
I believe this behaviour does differ by version. What version are you using?