Search code examples
c#selenium-webdrivernugetnunit-3.0package-manager-console

Facing NuGet issue "'5.0.0+42a8779499c1d1ed2488c2e6b9e2ee6ff6107766' is not a valid version string." while installing packages


I have created a console application for testing web applications in C#. All the packages are managed by NuGet package manager. When I try to install/uninstall packages via NuGet, I'm facing an exception.

Tools/Configurations

  1. Visual studio - Community 2013
  2. .NET Framework - 4.5.2 Selenium
  3. webdriver - 3.141.0
  4. MSBuild.NUnit version="1.0.2"
  5. NUnit version="3.12.0"
  6. NUnit3TestAdapter version="3.15.1" NU
  7. NUnitTestAdapter version="2.2.0"

Exception

PM> '5.0.0+42a8779499c1d1ed2488c2e6b9e2ee6ff6107766' is not a valid version string.
Parameter name: version

At line:1 char:50
+ '5.0.0+42a8779499c1d1ed2488c2e6b9e2ee6ff6107766' is not a valid versi ...
+                                                  ~~
Unexpected token 'is' in expression or statement.
PM> 
PM> Install-Package NuGet.Frameworks -Version 4.7.0
Install-Package : '5.0.0+42a8779499c1d1ed2488c2e6b9e2ee6ff6107766' is not a valid version string.
Parameter name: version
At line:1 char:1
+ Install-Package NuGet.Frameworks -Version 4.7.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], ArgumentException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackag 
   eCommand
 
PM> uninstall-package Microsoft.TestPlatform.TranslationLayer -version 16.6.1
uninstall-package : '5.0.0+42a8779499c1d1ed2488c2e6b9e2ee6ff6107766' is not a valid version string.
Parameter name: version
At line:1 char:1
+ uninstall-package Microsoft.TestPlatform.TranslationLayer -version 16 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Uninstall-Package], ArgumentException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.UninstallPack 
   ageCommand
 
PM> nuget update -self
nuget : The term 'nuget' is not recognized as the name of a cmdlet, function, script file, or 
operable program. Check the spelling of the name, or if a path was included, verify that the path 
is correct and try again.
At line:1 char:1
+ nuget update -self
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (nuget:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 

Installed NuGet


Solution

  • Somehow I managed to get the install/uninstall package working via Package manager console.

    I had tried these steps earlier, but not sure why it didn't worked then.

    1. Un-installed nuget : Tools > Extensions & updates > Installed > Nuget
    2. Re-installed nuget : Tools > Extensions & updates > Online[Visual Studio Gallery] > Nuget > Install
    3. Changed package manager settings : Tools > Nuget Package Manager > Package manager settings > Nuget Package manager > Package sources > Checked only "nuget.org", rest everthing was unchecked > Click "Ok".
    4. Restart the VS 2013(restart your system, if you want.)

    Install/Uninstall via package manager console screenshot

    Edit 1 : Able to see via UI as well. Able to see via UI as well