성태의 닷넷 이야기
홈 주인
모아 놓은 자료
프로그래밍
질문/답변
사용자 관리
사용자
메뉴
아티클
외부 아티클
유용한 코드
온라인 기능
MathJax 입력기
최근 덧글
[정성태] 제가 큰 실수를 했군요. ^^; Delegate를 통한 Bein...
[정성태] Working with Rust Libraries from C#...
[정성태] Detecting blocking calls using asyn...
[정성태] 아쉽게도, 커뮤니티는 아니고 개인 블로그입니다. ^^
[정성태] 질문이 잘 이해가 안 됩니다. 우선, 해당 소스코드에서 ILis...
[양승조
] var대신 dinamic으로 선언해서 해결은 했습니다. 맞는 해...
[양승조
] 또 막혔습니다. ㅠㅠ var list = props[i].Ge...
[양승조
] 아. 감사합니다. 어제는 안됐던것 같은데....정신을 차려야겠네...
[정성태] "props[i].GetValue(props[i])" 코드에서 ...
[정성태] 저렇게 조각 코드 말고, 실제로 재현이 되는 예제 프로젝트를 압...
글쓰기
제목
이름
암호
전자우편
HTML
홈페이지
유형
제니퍼 .NET
닷넷
COM 개체 관련
스크립트
VC++
VS.NET IDE
Windows
Team Foundation Server
디버깅 기술
오류 유형
개발 환경 구성
웹
기타
Linux
Java
DDK
Math
Phone
Graphics
사물인터넷
부모글 보이기/감추기
내용
<div style='display: inline'> <h1 style='font-family: Malgun Gothic, Consolas; font-size: 20pt; color: #006699; text-align: center; font-weight: bold'>Nuget config 파일에 값 설정/삭제 방법</h1> <p> NuGet.Config 파일은 계층적으로 있습니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > Common NuGet configurations ; <a target='tab' href='https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior'>https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior</a> </pre> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > [컴퓨터 레벨] Windows: %ProgramFiles(x86)%\NuGet\Config Mac/Linux: $XDG_DATA_HOME. If $XDG_DATA_HOME is null or empty, ~/.local/share or /usr/local/share will be used (varies by OS distribution) [사용자 레벨] Windows: %appdata%\NuGet\NuGet.Config Mac/Linux: ~/.config/NuGet/NuGet.Config or ~/.nuget/NuGet/NuGet.Config (varies by tooling) Additional configs are supported on all platforms. These configs cannot be edited by the tooling. Windows: %appdata%\NuGet\config\*.Config Mac/Linux: ~/.config/NuGet/config/*.config or ~/.nuget/config/*.config [솔루션 레벨] 솔루션 폴더 및 그것의 상위 폴더들 </pre> <br /> 해당 NuGet.Config 파일에 값을, 심지어 그냥 아무 의미 없는 값이라도 명령어를 통해 설정하는 것이 가능한데요,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > # [컴퓨터 레벨 - 관리자 권한 필요] nuget config -set repositoryPath=c:\packages -configfile %ProgramFiles(x86)%\NuGet\Config\NuGet.Config # [사용자 레벨] nuget config -set repositoryPath=c:\packages # [솔루션 레벨] nuget config -set repositoryPath=c:\packages -configfile c:\my.Config nuget config -set repositoryPath=c:\packages -configfile .\myApp\NuGet.Config </pre> <br /> 일례로, 사용자 레벨에 다음과 같이 값을 설정하면,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > C:\temp> <span style='color: blue; font-weight: bold'>nuget config -set testValue=5</span> </pre> <br /> "%appdata%\NuGet\NuGet.Config" 파일에는 다음과 같이 반영됩니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > <?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> <add key="Microsoft Visual Studio Offline Packages" value="C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\" /> <add key="dotnet-experimental" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json" /> <add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" /> </packageSources> <packageRestore> <add key="enabled" value="True" /> <add key="automatic" value="True" /> </packageRestore> <bindingRedirects> <add key="skip" value="False" /> </bindingRedirects> <packageManagement> <add key="format" value="1" /> <add key="disabled" value="False" /> </packageManagement> <span style='color: blue; font-weight: bold'><config> <add key="testValue" value="5" /> </config></span> </configuration> </pre> <br /> 그런데, 삭제가 안 됩니다. ^^; 일례로 문서에는 빈 값을 주면 삭제가 되는 것처럼 나오는데요,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > // Removing a value // <a target='tab' href='https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior#removing-a-value'>https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior#removing-a-value</a> # Windows nuget config -set repositoryPath= -configfile c:\my.Config # Mac/Linux nuget config -set repositoryPath= -configfile /home/my.Config </pre> <br /> 실제로 테스트를 해보면,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > c:\temp> <span style='color: blue; font-weight: bold'>dotnet new nugetconfig</span> c:\temp> <span style='color: blue; font-weight: bold'>type nuget.config</span> <?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <!--To inherit the global NuGet package sources remove the <clear/> line below --> <clear /> <add key="nuget" value="https://api.nuget.org/v3/index.json" /> </packageSources> </configuration> c:\temp> <span style='color: blue; font-weight: bold'>nuget config -set repositoryPath=c:\packages -configfile nuget.config</span> c:\temp> <span style='color: blue; font-weight: bold'>nuget config -set repositoryPath= -configfile nuget.config</span> c:\temp> <span style='color: blue; font-weight: bold'>nuget config repositoryPath</span> c:\packages </pre> <br /> 반영이 안 되는 것을 볼 수 있습니다. 아마도 현 시점(2023-12-15)의 버그인 듯한데, 어쩔 수 없습니다, ^^; 그냥 해당 파일을 메모장으로 열어 값을 직접 삭제해야 합니다.<br /> </p><br /> <br /><hr /><span style='color: Maroon'>[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]</span> </div>
첨부파일
스팸 방지용 인증 번호
1440
(왼쪽의 숫자를 입력해야 합니다.)