2021/02/20

Failed to add reference to '???'. Please make sure that it is in the Global Assembly Cache. 오류

심각도 코드 설명 프로젝트 파일 비표시 오류(Suppression) 상태

오류 Failed to add reference to 'System.Linq'. Please make sure that it is in the Global Assembly Cache. 0


> 기본 참조 라이브러리 목록에 없기 때문에, 직접 해당 dll 파일 위치를 찾아서 지정...? 이게 진정 해결책? C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Linq\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Linq.dll   이렇게 직접 지정 ???

Nuget 패키지 시스템 버그 인가..?


That's a very confusing error message since the GAC isn't used to resolve references at compile time. Visual Studio should be looking under C:\Program Files(x86)\Reference Assemblies but that location shouldn't be referred to as the Global Assembly Cache.  이런것?


C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\Facades 에는 System.Linq.dll 이 있는데 여기 폴더는 참조 안함.?




 



'GetPathsOfAllDirectoriesAbove() 식을 계산할 수 없습니다' 오류

기존 Webapp 에 컴파일 버전이 2.x 인데, Nuget 에서 3.8 로 업그레이드 실행. 그런데 오류나 가서 완료되지 않았고,..  다른 MS 기본 라이브러리 업데이트도 안됨..  다시 VS 실행하니 참조 라이브러리 모두 오류..


◯◯◯◯.csproj : error  : ""◯◯◯◯.cs".GetPathsOfAllDirectoriesAbove()" 식을 계산할 수 없습니다. 'System.String.GetPathsOfAllDirectoriesAbove' 메서드를 찾을 수 없습니다. ◯◯◯◯\packages\Microsoft.Net.Compilers.3.8.0\tools\Microsoft.Managed.Core.targets


일단, VS ◯◯◯◯.csproj 프로젝트 설정 파일에서, Microsoft.Net.Compilers.3.8.0 항목을 수동 제거하고, 프로젝트 다시 로딩... 일단 경고 에러는 안뜸...

  <Import Project="..\packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props')" />

  <Import Project="..\packages\Microsoft.Net.Compilers.2.3.2\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.2.3.2\build\Microsoft.Net.Compilers.props')" />


   <ErrorText>이 프로젝트는 이 컴퓨터에 없는 NuGet 패키지를 참조합니다. 해당 패키지를 다운로드하려면 NuGet 패키지 복원을 사용하십시오. 자세한 내용은 http://go.microsoft.com/fwlink/?LinkID=322105를 참조하십시오. 누락된 파일은 {0}입니다.</ErrorText>

    </PropertyGroup>

    <Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.2.3.2\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.2.3.2\build\Microsoft.Net.Compilers.props'))" />

    <Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props'))" />

  </Target>


닷넷 4.6.1 프로젝트에서는 컴파일 3.8 버전이 지원안되나..? (종속성에는 버전 제한이 없음)  오류 대상 .cs 파일에 위 에러 구문 연관 클래스를 사용한게 없는데.... 어떤글에선 VS.NET 2019 버전에서만 3.x 지원된다고.. (현재 VS2015, 닷넷 4.6.1 기반)

https://www.nuget.org/packages/Microsoft.Net.Compilers/2.10.0  내용을 보면, 닷넷 4.6.1 에서는 최대 2.1 버전 까지 이고, 3.x 버전은 4.7.2+ 필요하다고 되어 있음.. > Nuget 패키지 관리자에서는 왜 업데이트 하라고 띄운것이며, 종속성 검사는 왜 안한건지...?


■ OS 에 설치된 닷넷 파일 버전은 4.8 까지 표시가되고 있으나, VS.NET 에는 4.6.1 까지만 나옴.. 별도 지원 파일을 설치하면 가능 : https://dotnet.microsoft.com/download/visual-studio-sdks?utm_source=getdotnetsdk&utm_medium=referral  에서 4.8 개발자팩 다운로드 설치.


어쨌든... 닷넷 4.x 에서는 컴파일러 3.8 버전은 설치 안되는듯.. 닷넷 5 부터 되는듯.. 정말.?  아무튼 컴파일러 버전 업데이트 포기.. 



2020/07/30

HttpClient 에서 비동기 호출시 System.Threading.Tasks.Task 오류

client.PostAsync().Result;

하나 이상의 오류가 발생했습니다., 위치: System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) 이

요청을 보내는 동안 오류가 발생했습니다.

[SocketException (0x2746): 현재 연결은 원격 호스트에 의해 강제로 끊겼습니다]
[IOException: 전송 연결 현재 연결은 원격 호스트에 의해 강제로 끊겼습니다에서 데이터를 읽을 수 없습니다.]
[WebException: 기본 연결이 닫혔습니다. 보내기에서 예기치 않은 오류가 발생했습니다.]



여러가지 원인중 하나 >

System.Net.ServicePointManager.SecurityProtocol
System.Net.ServicePointManager.ServerCertificateValidationCallback

구성이 되어 있지 않은 경우에 발생할 수 있음.
예를 들면, 서버에서 TLS 1.2 만 허용하는데 클라이언트에서 SSL 3.0 으로 접속할때.



가장 많이 본 글