Visual Studio 2010에서 ASP.NET 4 프로젝트를 빌드하려고하면 다음 오류가 발생합니다. "파일 또는 어셈블리를로드 할 수 없습니다 : file : /// C : \ Dev \ project \ trunk \ bin \ Elmah.dll '또는 해당 종속성 중 하나입니다 (HRESULT의 예외 : 0x80131515). "VS2010 어셈블리로드 오류
dll이 실제로 존재하며 bin 폴더로 올바르게 복사되고 있음을 확인했습니다. 나는 또한 제거한 다음 프로젝트에 대한 참조를 다시 추가하려고 시도했다.
솔루션 구성을 "릴리스"로 전환하면 빌드가 실패합니다. 솔루션 구성이 "디버그"로 설정되어 있으면 실패하지 않습니다.
두 구성 사이의 유일한 차이점은 (내가 아는) 다음의 Web.config, 변환 Web.Release.config에 표시됩니다 :
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="SqlServer" connectionString="" providerName="System.Data.SqlClient" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<customErrors mode="On" xdt:Transform="Replace">
<error statusCode="404" redirect="lost.htm" />
<error statusCode="500" redirect="uhoh.htm" />
</customErrors>
</system.web>
</configuration>
나는 추적하는 퓨전 로그 뷰어를 사용하여 시도 어셈블리 바인딩 문제가 있지만 어셈블리를 올바르게 찾고로드하는 것처럼 보입니다. 로그는 다음과 같습니다.
*** Assembly Binder Log Entry (6/8/2010 @ 10:01:54 AM) ***
The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\sgen.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = User
LOG: Where-ref bind. Location = C:\Dev\project\trunk\bin\Elmah.dll
LOG: Appbase = file:///c:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/bin/NETFX 4.0 Tools/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = sgen.exe
Calling assembly : (Unknown).
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Attempting download of new URL file:///C:/Dev/project/trunk/bin/Elmah.dll.
LOG: Assembly download was successful. Attempting setup of file: C:\Dev\project\trunk\bin\Elmah.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Elmah, Version=1.1.11517.0, Culture=neutral, PublicKeyToken=null
LOG: Re-apply policy for where-ref bind.
LOG: Where-ref bind Codebase does not match what is found in default context. Keep the result in LoadFrom context.
LOG: Binding succeeds. Returns assembly from C:\Dev\project\trunk\bin\Elmah.dll.
LOG: Assembly is loaded in LoadFrom load context.
정확히 여기서 무슨 일이 벌어지고 있는지에 대한 기본적인 이해가 부족한 것 같습니다. 모든 설명/도움을 많이 주시면 감사하겠습니다!
0x80131515는 COR_E_NOTSUPPORTED입니다. 즉, 뭔가가 NotSupportedException을 던지고 있습니다. 그러나 Elmah 소스를 숨기면 포함 된 어셈블리를 제외하고는 NotSupportedException에 대한 참조가 없습니다. -/ – Rup
Visual Studio 2010 문제 일 수 있습니다. 그러나 그것은 물론 추측입니다. 해결 방법을 찾지 않으려 고합니다. –