August-September 2018 .NET Framework 업데이트 후 .NET 4.6 이상에서 SqlConnection 인스턴스화 예외

적용 대상
.NET Framework 4.6.2 .NET Framework 4.6.1 .NET Framework 4.6 .NET Framework 4.7 .NET Framework 4.7.1 .NET Framework 4.7.2

증상

품질 롤업의 8월 미리 보기 또는 2018년 9월 11일을 설치한 후 업데이트 .NET Framework SqlConnection 인스턴스화는 예외를 발생시킬 수 있습니다.

SqlConnection 생성자를 사용하면 다음과 유사한 스택 추적이 발생할 수 있습니다.

참고

System.Runtime.Serialization.SerializationException
   at System.AppDomain.get_Evidence()
   at System.AppDomain.get_Evidence()
   at System.Configuration.ClientConfigPaths.GetEvidenceInfo(AppDomain appDomain, String exePath, String& typeName)
   에서 System.Configuration.ClientConfigPaths.GetTypeAndHashSuffix(AppDomain appDomain, String exePath)
   System.Configuration.ClientConfigPaths에서 ctor(String exePath, Boolean includeUserConfig)
   에서 System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
   에서 System.Configuration.ClientConfigurationHost.RequireCompleteInit(IInternalConfigRecord 레코드)
   at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
   에서 System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
   에서 System.Configuration.ConfigurationManager.GetSection(String sectionName)
   System.Data.SqlClient.SqlConnection에서 cctor()

해결 방법

해결 방법 1

애플리케이션의 App.Config 파일 configSection에 다음 줄을 추가합니다.

<section name="SqlColumnEncryptionEnclaveProviders"
type="System.Data.SqlClient.SqlColumnEncryptionEnclaveProviderConfigurationSection,
System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

참고 애플리케이션에 app.config 파일이 없는 경우 configSection에 이 정보가 포함된 app.config 파일을 만들고 배포하는 것이 좋습니다.

해결 방법 1이 작동하지 않는 경우 해결 방법 2를 시도해 보세요.

해결 방법 2

개체가 논리 호출 컨텍스트에 추가되기 전에 실행되는 앱 도메인의 위치를 식별합니다. ConfigurationManager가 구성 파일에 없는 섹션을 로드하도록 강제하는 코드를 추가합니다. 예를 들면 다음과 같습니다.

System.Configuration.ConfigurationManager.GetSection("SectionNameThatDoesNotExistInAnyConfigurationFile");

이 문제에 대한 자세한 내용은 GitHub 문서 완화: 앱 도메인에서 개체의 역직렬화를 참조하세요.

상태

Microsoft는 이 문제를 조사하고 있으며 향후 릴리스에서 업데이트를 제공할 예정입니다.