2017-09-27 13 views
3

VS2017, C#, .Net Framework 4.6.2을 사용하여 응용 프로그램을 개발하고 있습니다.파일 또는 어셈블리를로드 할 수 없습니다. System.Xml.XPath - .Net 4.6.2 참조 .Net Standard 1.3

나는 GeocodingGoogle 너겟 패키지를 설치 한 클래스 라이브러리가 있습니다. 그 라이브러리는 Net Standard 1.3입니다.

System.Xml.XPath과 함께 몇 가지 다른 라이브러리에 대한 추가 종속성입니다. 내가

var geocoder = new GoogleGeocoder("key"); 

var task = geocoder.GeocodeAsync(searchString); 

task.Wait() 

Geocoding.net 방법 중 하나를 액세스 할 때

은 비록, 런타임 중에, 내가 무엇을 할 아무 생각이 오류

System.AggregateException occurred 
    HResult=0x80131500 
    Message=One or more errors occurred. 
    Source=mscorlib 
    StackTrace: 
    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) 
    at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) 
    at System.Threading.Tasks.Task.Wait() 
    at Easymage.TEC.Entities.Application.QueryHandlers.AddressSearchQueryHandler.Handle(AddressSearchQuery query) in C:\Users\Ludovic\Source\Repos\Easymage.TEC\Easymage.TEC.Entities.Application\QueryHandlers\AddressSearchQueryHandler.cs:line 32 

Inner Exception 1: 
GoogleGeocodingException: There was an error processing the geocoding request. See Status or InnerException for more information. 

Inner Exception 2: 
FileLoadException: Could not load file or assembly 'System.Xml.XPath, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 

Inner Exception 3: 
FileLoadException: Could not load file or assembly 'System.Xml.XPath, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 

를 얻을. System.XML.XPath 파일은 출력 폴더에 있습니다.

<dependentAssembly> 
    <assemblyIdentity name="System.Xml.XPath" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> 
    <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> 
    </dependentAssembly> 

<dependentAssembly> 
    <assemblyIdentity name="System.Xml.XPath" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> 
    <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.1.0" /> 
    </dependentAssembly> 

아무것도 작동하는 것 같다없는이 하나

나는 어셈블리 바인딩 리디렉션을 추가했습니다. 나는 항상이 오류가 발생합니다.

=== Pre-bind state information === 
LOG: DisplayName = System.Xml.XPath, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 
(Fully-specified) 
LOG: Appbase = file:///C:/Users/Ludovic/Source/Repos/Easymage.TEC/bin/Server/Debug/ 
LOG: Initial PrivatePath = NULL 
Calling assembly : Geocoding.Google, Version=4.0.0.0, Culture=neutral, PublicKeyToken=48f410544ef36ab4. 
=== 
LOG: This bind starts in default load context. 
LOG: Using application configuration file: C:\Users\Ludovic\Source\Repos\Easymage.TEC\bin\Server\Debug\Easymage.TEC.ServiceHost.exe.Config 
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. 
LOG: Redirect found in application configuration file: 4.0.1.0 redirected to 4.0.2.0. 
LOG: Post-policy reference: System.Xml.XPath, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 
LOG: The same bind was seen before, and was failed with hr = 0x80131040. 

이 바인딩 리디렉션없이 융합 로그입니다 :

=== Pre-bind state information === 
LOG: DisplayName = System.Xml.XPath, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 
(Fully-specified) 
LOG: Appbase = file:///C:/Users/Ludovic/Source/Repos/Easymage.TEC/bin/Server/Debug/ 
LOG: Initial PrivatePath = NULL 
Calling assembly : Geocoding.Google, Version=4.0.0.0, Culture=neutral, PublicKeyToken=48f410544ef36ab4. 
=== 
LOG: This bind starts in default load context. 
LOG: Using application configuration file: C:\Users\Ludovic\Source\Repos\Easymage.TEC\bin\Server\Debug\Easymage.TEC.ServiceHost.exe.Config 
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. 
LOG: Post-policy reference: System.Xml.XPath, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 
LOG: Attempting download of new URL file:///C:/Users/Ludovic/Source/Repos/Easymage.TEC/bin/Server/Debug/System.Xml.XPath.DLL. 
WRN: Comparing the assembly name resulted in the mismatch: Build Number 
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated. 
+1

영어 버전의 오류 메시지를 게시하는 것이 좋습니다. 더 많은 견인력을 얻을 것입니다. – Saleem

+0

@Saleem Done! :) – Ludo

+0

.net 프레임 워크 4.6.2 및 .net core 2.0 콘솔 프로젝트로 테스트되었습니다. 괜찮 았어. 오류 없음. – Saleem

답변

0

이이 Asp.Net 프로젝트 인 경우는, 시스템을 설치

는 바인딩 리디렉션와 융합 로그입니다 .Xml.Xpath 패키지를 웹 프로젝트에 추가하십시오. 내 서비스 프로젝트 (API 컨트롤러에서 별도의 프로젝트)에 Geocoding lib를 설치했기 때문에이 문제가 발생했습니다. 나는 Xpath Nuget을 웹 프로젝트에 수동으로 설치해야했고, 그것을 해결했다.