If you are running VS 2010 SP1, you might run into the following error message when attempting to upgrade NuGet if you have an older version installed.
When viewing the logs, you might see a mention of a
To prevent this from occurring, there is a Visual Studio 2010 SP1 hotfix you can install. Alternatively, the workaround is to simply uninstall NuGet and then install it from the VS Extension Gallery. See http://support.microsoft.com/kb/2581019 for more information.
When running the Package Manager console, you may run into the following exception message if you have the Reflector VS Add-in installed.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2950) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: Cannot convert the "Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase" value of type "System.String" to type "System.Type". System.Management.Automation.ActionPreferenceStopException: Command execution stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Unable to find type
System.Management.Automation.CmdletInvocationException: Could not load file or assembly 'Scripts\nuget.psm1' or one of its dependencies. <br />The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) ---> System.IO.FileLoadException: Could not load file or <br />assembly 'Scripts\nuget.psm1' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) <br />---> System.ArgumentException: Illegal characters in path. at System.IO.Path.CheckInvalidPathChars(String path) at System.IO.Path.Combine(String path1, String path2) at Microsoft.VisualStudio.Platform.VsAppDomainManager.<AssemblyPaths>d__1.MoveNext() at Microsoft.VisualStudio.Platform.VsAppDomainManager.InnerResolveHandler(String name) at Microsoft.VisualStudio.Platform.VsAppDomainManager.ResolveHandler(Object sender, ResolveEventArgs args) at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName) --- End of inner exception stack trace --- at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadBinaryModule(Boolean trySnapInName, String moduleName, String fileName, <br />Assembly assemblyToLoad, String moduleBase, SessionState ss, String prefix, Boolean loadTypes, Boolean loadFormats, Boolean& found) at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleNamedInManifest(String moduleName, String moduleBase, <br />Boolean searchModulePath, <br />String prefix, SessionState ss, Boolean loadTypesFiles, Boolean loadFormatFiles, Boolean& found) at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleManifest(ExternalScriptInfo scriptInfo, ManifestProcessingFlags <br />manifestProcessingFlags, Version version) at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModule(String fileName, String moduleBase, String prefix, SessionState ss, <br />Boolean& found) at Microsoft.PowerShell.Commands.ImportModuleCommand.ProcessRecord() at System.Management.Automation.Cmdlet.DoProcessRecord() at System.Management.Automation.CommandProcessor.ProcessRecord() --- End of inner exception stack trace --- at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) at System.Management.Automation.Runspaces.Pipeline.Invoke() at NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.Invoke(String command, Object input, Boolean outputResults) at NuGetConsole.Host.PowerShell.Implementation.PowerShellHostExtensions.ImportModule(PowerShellHost host, String modulePath) at NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.LoadStartupScripts() at NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.Initialize() at NuGetConsole.Implementation.Console.ConsoleDispatcher.Start() at NuGetConsole.Implementation.PowerConsoleToolWindow.MoveFocus(FrameworkElement consolePane)
We've contacted the author of the add-in in the hopes of working out a resolution.
Update: We have verified that the latest version of Reflector, 6.5, no longer causes this exception in the console.
We have identified that if your solution contains one or more InstallShield Limited Edition project, the Add Package Library Reference dialog will throw an exception when opened. There is currently no workaround yet except either removing InstallShield projects or unloading them.
If you try to uninstall NuGet via the Visual Studio Extension Manager, you may notice that the Uninstall button is disabled. NuGet requires admin access to install and uninstall. Relaunch Visual Studio as an administrator to uninstall the extension. NuGet does not require admin access to use it.
NuGet requires Powershell 2.0 runtime. Windows XP, by default, doesn't have Powershell 2.0. You can download the Powershell 2.0 runtime from this link http://support.microsoft.com/kb/968929. After you install it, restart Visual Studio and you should be able to open Package Manager Console.
If you have installed Visual Studio 2010 SP1 Beta, you may notice that if you leave the Package Manager Console open and close Visual Studio, it will crash. This is a known issue of Visual Studio and will be fixed in SP1 RTM release. For now, just ignore the crash or uninstall SP1 Beta if you can.
If you installed packages built with a pre-release version of NuGet, you might encounter this error message when running the RTM version of NuGet with that project. You'll need to uninstall and then re-install each package using the RTM version of NuGet.
For some reason, Visual Studio extensions can get in a weird state where you've uninstalled the VSIX extension, but some files were left behind. To work around this issue:
Open the following folder (it might be on a different drive on your machine)
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft Corporation\NuGet Package Manager\<version>\
Delete all the files with the .deleteme extensions.
After following these steps, you should be able to continue.
You might get the following error if you installs FluentNHibernate with the Package Manager console and then compile your project with "Code Analysis" turned on.
Error 3 CA0058 : The referenced assembly 'NHibernate, Version=184.108.40.2061, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' could not be found. This assembly is required for analysis and was referenced by: C:\temp\Scratch\src\MyProject.UnitTests\bin\Debug\MyProject.UnitTests.dll. MyProject.UnitTests
David Kean has an Excellent BLog post that explains this issue. By default, FluentNHibernate requires NHibernate 220.127.116.111. However, by design NuGet will install NHibernate 18.104.22.16800 in your project and add the appropriate binding redirects so that it will work. You project will compile just fine if code analysis is not turned on. In contrast to the compiler, code analysis tool doesn't properly follow the binding redirects to use 22.214.171.12400 instead of 126.96.36.1991. You can work around the issue by either installing NHibernate 188.8.131.521 or tell the code analysis tool to behave the same as the compiler by doing the following:
This is a known issue. Instead of calling Write-Error, try calling throw.
throw "My error message"
When attempting to install NuGet using the Visual Studio Extension Manager and not running as an administrator, the “Run As” dialog is displayed with the checkbox labeled “Run this program with restricted access” checked by default.
Clicking OK with that checked crashes Visual Studio. Make sure to uncheck that option before installing NuGet.
Windows Phone Tools does not have support for the Visual Studio Extension Manager. In order to uninstall NuGet, run the following command.