我的情况很简单。我创建了一个空项目,一个类库。我进入包管理器并点击Install-Package xunit
。不起作用。
但是,例如Newtonsoft.Json
确实有效。更重要的是,即使旧版本的xunit
也有效:2.1.0-beta4-build3109
。以下版本2.1.0-rc1-build3168
似乎正在添加一个新包:xunit.extensibility.execution 2.1.0-rc1-build3168
,它可能会使整个流程崩溃。
请帮助,我不知道我还能做什么< 3
Package Manager Console Host Version 3.2.0.10516
Type 'get-help NuGet' to see all available NuGet commands.
PM> Install-Package xunit
Attempting to gather dependencies information for package 'xunit.2.1.0' with respect to project 'Test', targeting '.NETFramework,Version=v4.6'
Attempting to resolve dependencies for package 'xunit.2.1.0' with DependencyBehavior 'Lowest'
Resolving actions to install package 'xunit.2.1.0'
Resolved actions to install package 'xunit.2.1.0'
Removed package 'xunit.2.1.0-beta4-build3109' from 'packages.config'
Successfully uninstalled 'xunit.2.1.0-beta4-build3109' from Test
Removed package 'xunit.assert.2.1.0-beta4-build3109' from 'packages.config'
Successfully uninstalled 'xunit.assert.2.1.0-beta4-build3109' from Test
Removed package 'xunit.core.2.1.0-beta4-build3109' from 'packages.config'
Successfully uninstalled 'xunit.core.2.1.0-beta4-build3109' from Test
Removed package 'xunit.extensibility.core.2.1.0-beta4-build3109' from 'packages.config'
Successfully uninstalled 'xunit.extensibility.core.2.1.0-beta4-build3109' from Test
Adding package 'xunit.assert.2.1.0' to folder 'C:\Users\Name\Desktop\Test\packages'
Added package 'xunit.assert.2.1.0' to folder 'C:\Users\Name\Desktop\Test\packages'
Added package 'xunit.assert.2.1.0' to 'packages.config'
Successfully installed 'xunit.assert 2.1.0' to Test
Adding package 'xunit.extensibility.core.2.1.0' to folder 'C:\Users\Name\Desktop\Test\packages'
Added package 'xunit.extensibility.core.2.1.0' to folder 'C:\Users\Name\Desktop\Test\packages'
Added package 'xunit.extensibility.core.2.1.0' to 'packages.config'
Successfully installed 'xunit.extensibility.core 2.1.0' to Test
Install failed. Rolling back...
Package 'xunit.extensibility.execution 2.1.0' does not exist in project 'Test'
Removed package 'xunit.extensibility.core 2.1.0' from 'packages.config'
Removed package 'xunit.assert 2.1.0' from 'packages.config'
Package 'xunit.extensibility.core.2.1.0-beta4-build3109' already exists in folder 'C:\Users\Name\Desktop\Test\packages'
Added package 'xunit.extensibility.core.2.1.0-beta4-build3109' to 'packages.config'
Package 'xunit.core.2.1.0-beta4-build3109' already exists in folder 'C:\Users\Name\Desktop\Test\packages'
Added package 'xunit.core.2.1.0-beta4-build3109' to 'packages.config'
Package 'xunit.assert.2.1.0-beta4-build3109' already exists in folder 'C:\Users\Name\Desktop\Test\packages'
Added package 'xunit.assert.2.1.0-beta4-build3109' to 'packages.config'
Adding package 'xunit.2.1.0-beta4-build3109', which only has dependencies, to project 'Test'.
Package 'xunit.2.1.0-beta4-build3109' already exists in folder 'C:\Users\Name\Desktop\Test\packages'
Added package 'xunit.2.1.0-beta4-build3109' to 'packages.config'
Package 'xunit.extensibility.execution 2.1.0' does not exist in folder 'C:\Users\Name\Desktop\Test\packages'
Removing package 'xunit.extensibility.core 2.1.0' from folder 'C:\Users\Name\Desktop\Test\packages'
Removed package 'xunit.extensibility.core 2.1.0' from folder 'C:\Users\Name\Desktop\Test\packages'
Removing package 'xunit.assert 2.1.0' from folder 'C:\Users\Name\Desktop\Test\packages'
Removed package 'xunit.assert 2.1.0' from folder 'C:\Users\Name\Desktop\Test\packages'
Install-Package : Object reference not set to an instance of an object.
At line:1 char:1
+ Install-Package xunit
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
PM>