伙计们,
我以前在一个项目上使用过Twilio,并且工作正常。但是我试图在同一开发机器上的另一个项目上使用它。它不断抛出以下错误。
任何有帮助的人
Install-Package Twilio
Attempting to gather dependencies information for package 'Twilio.5.37.4' with respect to project 'Newzone_CreditFacility', targeting '.NETFramework,Version=v4.5.2'
Attempting to resolve dependencies for package 'Twilio.5.37.4' with DependencyBehavior 'Lowest'
Resolving actions to install package 'Twilio.5.37.4'
Resolved actions to install package 'Twilio.5.37.4'
Adding package 'Microsoft.IdentityModel.Logging.1.1.2' to folder 'c:\users\owner\documents\visual studio 2015\Projects\Newzone_CreditFacility\packages'
Added package 'Microsoft.IdentityModel.Logging.1.1.2' to folder 'c:\users\owner\documents\visual studio 2015\Projects\Newzone_CreditFacility\packages'
Added package 'Microsoft.IdentityModel.Logging.1.1.2' to 'packages.config'
Successfully installed 'Microsoft.IdentityModel.Logging 1.1.2' to Newzone_CreditFacility
Adding package 'Newtonsoft.Json.10.0.1' to folder 'c:\users\owner\documents\visual studio 2015\Projects\Newzone_CreditFacility\packages'
Added package 'Newtonsoft.Json.10.0.1' to folder 'c:\users\owner\documents\visual studio 2015\Projects\Newzone_CreditFacility\packages'
Added package 'Newtonsoft.Json.10.0.1' to 'packages.config'
Executing script file 'c:\users\owner\documents\visual studio 2015\Projects\Newzone_CreditFacility\packages\Newtonsoft.Json.10.0.1\tools\install.ps1'
Successfully installed 'Newtonsoft.Json 10.0.1' to Newzone_CreditFacility
Adding package 'Microsoft.IdentityModel.Tokens.5.1.2' to folder 'c:\users\owner\documents\visual studio 2015\Projects\Newzone_CreditFacility\packages'
Added package 'Microsoft.IdentityModel.Tokens.5.1.2' to folder 'c:\users\owner\documents\visual studio 2015\Projects\Newzone_CreditFacility\packages'
Added package 'Microsoft.IdentityModel.Tokens.5.1.2' to 'packages.config'
Successfully installed 'Microsoft.IdentityModel.Tokens 5.1.2' to Newzone_CreditFacility
Adding package 'System.IdentityModel.Tokens.Jwt.5.1.2' to folder 'c:\users\owner\documents\visual studio 2015\Projects\Newzone_CreditFacility\packages'
Added package 'System.IdentityModel.Tokens.Jwt.5.1.2' to folder 'c:\users\owner\documents\visual studio 2015\Projects\Newzone_CreditFacility\packages'
Added package 'System.IdentityModel.Tokens.Jwt.5.1.2' to 'packages.config'
Successfully installed 'System.IdentityModel.Tokens.Jwt 5.1.2' to Newzone_CreditFacility
Install failed. Rolling back...
Package 'Twilio 5.37.4' does not exist in project 'Newzone_CreditFacility'
Removed package 'System.IdentityModel.Tokens.Jwt 5.1.2' from 'packages.config'
Removed package 'Microsoft.IdentityModel.Tokens 5.1.2' from 'packages.config'
Removed package 'Newtonsoft.Json 10.0.1' from 'packages.config'
Removed package 'Microsoft.IdentityModel.Logging 1.1.2' from 'packages.config'
Package 'Twilio 5.37.4' does not exist in folder 'c:\users\owner\documents\visual studio 2015\Projects\Newzone_CreditFacility\packages'
Removing package 'System.IdentityModel.Tokens.Jwt 5.1.2' from folder 'c:\users\owner\documents\visual studio 2015\Projects\Newzone_CreditFacility\packages'
Removed package 'System.IdentityModel.Tokens.Jwt 5.1.2' from folder 'c:\users\owner\documents\visual studio 2015\Projects\Newzone_CreditFacility\packages'
Removing package 'Microsoft.IdentityModel.Tokens 5.1.2' from folder 'c:\users\owner\documents\visual studio 2015\Projects\Newzone_CreditFacility\packages'
Removed package 'Microsoft.IdentityModel.Tokens 5.1.2' from folder 'c:\users\owner\documents\visual studio 2015\Projects\Newzone_CreditFacility\packages'
Removing package 'Newtonsoft.Json 10.0.1' from folder 'c:\users\owner\documents\visual studio 2015\Projects\Newzone_CreditFacility\packages'
Removed package 'Newtonsoft.Json 10.0.1' from folder 'c:\users\owner\documents\visual studio 2015\Projects\Newzone_CreditFacility\packages'
Removing package 'Microsoft.IdentityModel.Logging 1.1.2' from folder 'c:\users\owner\documents\visual studio 2015\Projects\Newzone_CreditFacility\packages'
Removed package 'Microsoft.IdentityModel.Logging 1.1.2' from folder 'c:\users\owner\documents\visual studio 2015\Projects\Newzone_CreditFacility\packages'
Install-Package : Object reference not set to an instance of an object.
At line:1 char:1
+ Install-Package Twilio
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId :
NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
答案 0 :(得分:1)
以下是您可以尝试解决此问题的一些步骤:您在每个步骤之后都要检查分辨率
%appdata% > Roaming
中存在的Nuget文件夹重命名为Nuget.old Tools > Extensions and Updates
下的更新cache
下的文件夹cache.old
重命名为AppData\Local\NuGet\
如果没有任何效果,则可以尝试重新安装软件包管理器,请参见reference