이러한 문제는 반복적으로 보고되는 NuGet의 가장 일반적인 알려진 문제입니다. NuGet을 설치하거나 패키지를 관리하는 데 문제가 있는 경우 알려진 문제 및 해결 방법에 대해 살펴보세요.
비고
NuGet 4.0부터 알려진 문제는 각 릴리스 정보 중 일부입니다.
Visual Studio 17.10에서 packages.config 사용하는 프로젝트에 NuGet 감사 설정이 올바르게 적용되지 않을 수 있습니다.
NuGet 6.10 및 Visual Studio 17.10부터 packages.config 프로젝트에 대해 NuGet 감사 지원이 추가되었습니다. NuGet 감사를 구성하는 방법에 대한 정보는 감사 패키지에 대한 문서에서 찾을 수 있습니다.
문제:
솔루션에서 packages.config 사용하는 두 개 이상의 프로젝트가 동일한 프로젝트 이름을 사용하는 경우 NuGet 감사에서 하나를 선택하고 두 프로젝트에 대해 동일한 NuGet 감사 설정을 사용합니다.
이 제한을 제거하는 추적 문제는 GitHub에서 사용할 수 있습니다.
해결 방법:
이름이 같은 모든 프로젝트가 동일한 구성 값을 사용하는 경우 NuGet이 다른 프로젝트의 구성을 사용하여 한 프로젝트를 복원할 때 기능적 차이가 없습니다.
NuGet.exe 이 제한이 없으므로 NuGet.exe다운로드 하고 솔루션에서 실행 NuGet.exe restore 하여 명령줄에서 NuGet 감사 경고가 Visual Studio에서 보고하는 것과 다른지 확인할 수 있습니다.
프로젝트 이름이 다르도록 프로젝트의 이름을 바꿀 수 있는 경우 이 문제 시나리오가 발생하지 않습니다.
nuget.exe v3.4.3을 사용하는 VSTS의 NuGet 피드에 대한 인증 문제
문제:
다음 명령을 사용하여 자격 증명을 저장하면 개인 액세스 토큰을 이중으로 암호화합니다.
$PAT = "개인용 액세스 토큰" $Feed = "Url" .\nuget.exe 원본은 -Name 테스트 -Source $Feed -UserName $UserName -Password $PAT 추가합니다.
해결 방법:
-StorePasswordInClearText 옵션을 사용하여 암호를 일반 텍스트로 저장합니다.
NuGet 3.4, 3.4.1을 사용하여 패키지를 설치하는 동안 오류가 발생했습니다.
문제:
NuGet 3.4 및 3.4.1에서는 NuGet 추가 기능을 사용하는 경우 사용 가능한 원본이 보고되지 않으며 구성 창에서 새 원본을 추가할 수 없습니다. 결과는 아래 이미지와 유사합니다.
NuGet.Config 파일이 %AppData%\NuGet\ (Windows) 또는 ~/.nuget/ (Mac/Linux) 폴더에서 실수로 비워졌습니다. 이 문제를 해결하려면 Visual Studio(Windows에서 해당하는 경우)를 닫고 파일을 삭제 NuGet.Config 한 다음 작업을 다시 시도합니다. NuGet에서 새 NuGet.Config 항목을 생성했으며 계속 진행할 수 있어야 합니다.
NuGet 2.7을 사용하여 패키지를 설치하는 동안 오류가 발생했습니다.
문제:
NuGet 2.7 이상에서 어셈블리 참조가 포함된 패키지를 설치하려고 하면 아래와 같이 "입력 문자열이 올바른 형식이 아닙니다."라는 오류 메시지가 표시될 수 있습니다.
install-package log4net
Installing 'log4net 2.0.0'.
Successfully installed 'log4net 2.0.0'.
Adding 'log4net 2.0.0' to Tyson.OperatorUpload.
Install failed. Rolling back...
install-package : Input string was not in a correct format.
At line:1 char:1
install-package log4net
~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : NotSpecified: (:) [Install-Package], FormatException
FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
이는 COM 구성 요소의 형식 라이브러리가 VSLangProj.dll 시스템에서 등록 취소되어 있기 때문입니다. 예를 들어 두 가지 버전의 Visual Studio가 나란히 설치되어 있고 이전 버전을 제거하면 이 문제가 발생할 수 있습니다. 이렇게 하면 위 COM 라이브러리의 등록을 실수로 취소할 수 있습니다.
해결 방법::
관리자 권한 프롬프트에서 이 명령을 실행하여 VSLangProj.dll 형식 라이브러리를 다시 등록합니다.
regsvr32 "C:\Program Files (x86)\Common Files\microsoft shared\MSEnv\VsLangproj.olb"
명령이 실패하면 파일이 해당 위치에 있는지 확인합니다.
이 오류에 대한 자세한 내용은 다음 [work item](https://nuget.codeplex.com/workitem/3609 "Work item 3609")을 참조하세요.
VS 2012에서 패키지 업데이트 후 빌드 실패
문제: VS 2012 RTM을 사용하고 있습니다. NuGet 패키지를 업데이트할 때 "하나 이상의 패키지를 제거할 수 없습니다."라는 메시지가 표시되고 Visual Studio를 다시 시작하라는 메시지가 표시됩니다. VS를 다시 시작하면 이상한 빌드 오류가 발생합니다.
그 이유는 이전 패키지의 특정 파일이 백그라운드 MSBuild 프로세스에 의해 잠겨 있기 때문에 발생합니다. VS를 다시 시작한 후에도 백그라운드 MSBuild 프로세스는 이전 패키지의 파일을 계속 사용하므로 빌드 오류가 발생합니다.
VS 2012 업데이트(예: VS 2012 업데이트 2)를 설치하는 것이 수정되었습니다.
이전 버전에서 최신 NuGet으로 업그레이드하면 서명 확인 오류가 발생합니다.
VS 2010 SP1을 실행하는 경우 이전 버전이 설치된 경우 NuGet을 업그레이드하려고 할 때 다음 오류 메시지가 표시될 수 있습니다.
로그를 볼 때 SignatureMismatchException에 대한 언급이 표시될 수 있습니다.
이 문제가 발생하지 않도록 하기 위해 설치할 수 있는 Visual Studio 2010 SP1 핫픽스가 있습니다. 또는 해결 방법은 단순히 NuGet을 제거한 다음(관리자 권한으로 Visual Studio를 실행하는 동안) VS 확장 갤러리에서 설치하는 것입니다. 자세한 내용은 https://support.microsoft.com/kb/2581019을 참조하세요.
Reflector Visual Studio Add-In이 설치되어 있을 때 패키지 관리자 콘솔에서 예외를 발생시킵니다.
Package Manager 콘솔을 실행할 때 Reflector VS 추가 기능이 설치된 경우 다음 예외 메시지가 표시될 수 있습니다.
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)
해결을 위해 추가 기능 작성자에게 문의했습니다.
업데이트: 최신 버전의 Reflector 6.5가 더 이상 콘솔에서 이 예외를 일으키지 않는지 확인했습니다.
ObjectSecurity 예외로 패키지 관리자 콘솔 열기 실패
패키지 관리자 콘솔을 열려고 할 때 다음과 같은 오류가 표시될 수 있습니다.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2977) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2984) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2991) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2998) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(3005) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The term 'Get-ExecutionPolicy' 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.
그렇다면 StackOverflow에 설명된 솔루션에 따라 해결합니다.
패키지 라이브러리 추가 참조 대화 상자는 솔루션에 InstallShield Limited Edition 프로젝트가 포함된 경우 예외를 throw합니다.
솔루션에 하나 이상의 InstallShield Limited Edition 프로젝트가 포함된 경우 패키지 라이브러리 참조 추가 대화 상자가 열리면 예외가 throw되는 것으로 확인되었습니다. 현재 InstallShield 프로젝트를 제거하거나 언로드하는 것 외에는 아직 해결 방법이 없습니다.
제거 단추가 회색으로 표시되었나요? NuGet을 설치/제거하려면 관리자 권한이 필요합니다.
Visual Studio 확장 관리자를 통해 NuGet을 제거하려고 하면 제거 단추가 비활성화된 것을 알 수 있습니다. NuGet을 설치하고 제거하려면 관리자 액세스 권한이 필요합니다. Visual Studio를 관리자로 다시 실행하여 확장을 제거합니다. NuGet을 사용하려면 관리자 액세스 권한이 필요하지 않습니다.
Windows XP에서 열면 패키지 관리자 콘솔이 충돌합니다. 뭐가 문제인가요?
NuGet에는 Powershell 2.0 런타임이 필요합니다. Windows XP에는 기본적으로 Powershell 2.0이 없습니다. PowerShell 2.0 다운로드에서 Powershell 2.0 런타임을 다운로드할 수 있습니다. 설치한 후 Visual Studio를 다시 시작하면 패키지 관리자 콘솔을 열 수 있습니다.
패키지 관리자 콘솔이 열려 있으면 Visual Studio 2010 SP1 베타가 종료 시 충돌합니다.
Visual Studio 2010 SP1 베타를 설치한 경우 패키지 관리자 콘솔을 열어 두고 Visual Studio를 닫으면 작동이 중단될 수 있습니다. 이는 Visual Studio의 알려진 문제이며 SP1 RTM 릴리스에서 해결될 예정입니다. 일단 크래시를 무시하거나 가능하다면 SP1 베타를 삭제하세요.
요소 '메타데이터'에 잘못된 자식 요소로 인해 예외가 발생하였습니다.
시험판 버전의 NuGet으로 빌드된 패키지를 설치한 경우 해당 프로젝트에서 NuGet의 RTM 버전을 실행할 때 "네임스페이스 'schemas.microsoft.com/packaging/2010/07/nuspec.xsd'의 요소 '메타데이터'에 잘못된 자식 요소가 있습니다"라는 오류 메시지가 표시될 수 있습니다. NUGet의 RTM 버전을 사용하여 각 패키지를 제거한 다음 다시 설치해야 합니다.
설치 또는 제거를 시도하면 "파일이 이미 있을 때 파일을 만들 수 없습니다." 오류가 발생합니다.
어떤 이유로 Visual Studio 확장은 VSIX 확장을 제거했지만 일부 파일이 남아 있는 이상한 상태가 될 수 있습니다. 이 문제를 해결하려면
Visual Studio 종료
다음 폴더를 엽니다(컴퓨터의 다른 드라이브에 있을 수 있습니다).
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft Corporation\NuGet Package Manager<version>\
.deleteme 확장자를 사용하여 모든 파일을 삭제합니다.
Visual Studio 다시 열기
이 단계를 수행한 후에는 계속 진행할 수 있습니다.
드물게 코드 분석을 사용하여 컴파일하면 오류가 발생합니다.
패키지 관리자 콘솔과 함께 FluentNHibernate를 설치한 다음 "코드 분석"이 켜져 있는 상태에서 프로젝트를 컴파일하는 경우 다음 오류가 발생할 수 있습니다.
Error 3 CA0058 : The referenced assembly
'NHibernate, Version=3.0.0.2001, 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
기본적으로 FluentNHibernate에는 NHibernate 3.0.0.2001이 필요합니다. 원래 설계대로 NuGet은 프로젝트에 NHibernate 3.0.0.4000을 설치하고 올바른 바인딩 리디렉션을 추가하여 기능이 제대로 작동하도록 합니다. 코드 분석이 켜져 있지 않으면 프로젝트가 잘 컴파일됩니다. 컴파일러와 달리 코드 분석 도구는 바인딩 리디렉션을 제대로 따르지 않아 3.0.0.2001 대신 3.0.0.4000을 사용합니다. NHibernate 3.0.0.2001을 설치하거나 다음을 수행하여 코드 분석 도구에 컴파일러와 동일하게 동작하도록 지시하여 문제를 해결할 수 있습니다.
- %PROGRAMFILES%\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop으로 이동합니다.
- FxCopCmd.exe.config을 열고
AssemblyReferenceResolveMode에서StrongName를StrongNameIgnoringVersion로 변경합니다. - 변경 내용을 저장하고 프로젝트를 다시 빌드합니다.
Write-Error 명령은 install.ps1/uninstall.ps1/init.ps1 내에서 작동하지 않습니다.
이것은 알려진 문제입니다. 쓰기 오류를 호출하는 대신 throw를 호출해 봅니다.
throw "My error message"
Windows 2003에서 제한된 액세스 권한으로 NuGet을 설치하면 Visual Studio가 충돌할 수 있습니다.
Visual Studio 확장 관리자를 사용하여 NuGet을 설치하려고 하고 관리자 권한으로 실행되지 않는 경우 기본적으로 "제한된 액세스 권한으로 이 프로그램 실행" 확인란과 함께 "실행" 대화 상자가 표시됩니다.
그 옵션을 선택한 상태에서 확인을 클릭하면 Visual Studio가 충돌합니다. NuGet을 설치하기 전에 해당 옵션을 선택 취소해야 합니다.
Windows Phone 도구용 NuGet을 제거할 수 없음
Windows Phone 도구는 Visual Studio 확장 관리자를 지원하지 않습니다. NuGet을 제거하려면 다음 명령을 실행합니다.
vsixinstaller.exe /uninstall:NuPackToolsVsix.Microsoft.67e54e40-0ae3-42c5-a949-fddf5739e7a5
NuGet 패키지 ID의 대문자 표시 변경으로 패키지 복원 중단
이 GitHub 문제에 대해 설명한 대로 NuGet 패키지의 대/소문자 변경은 NuGet 지원에서 수행할 수 있지만, 글로벌 패키지 폴더에 서로 다른 기존 패키지가 있는 사용자의 패키지 복원 중에 복잡성이 발생합니다. 빌드 시간 패키지 복원에 발생할 수 있는 중단에 대해 패키지의 기존 사용자와 통신할 수 있는 방법이 있는 경우에만 사례 변경을 요청하는 것이 좋습니다.
문제 신고
NuGet 문제를 보고하려면 을 방문하세요 https://github.com/nuget/home/issues.