파일 또는 어셈블리를로드 할 수 없습니다 ... Windows Azure 웹 사이트

스티븐 예이츠

나는 주변에 이러한 게시물이 많이 있다는 것을 이해하고 이번을 제외하고는 문제없이 이전에 이것들을 혼자 다루었습니다. Windows Azure에서 필요한 디버그 정보를 얻을 수없고 누군가가 나를 도울 수 있기를 바라기 때문입니다.

이 모든 작업은 내 로컬 환경, 디버그 및 릴리스에서 완벽하게 작동합니다.

이 오류가 발생합니다. 파일 또는 어셈블리 'Lib'또는 해당 종속성 중 하나를로드 할 수 없습니다. 잘못된 형식으로 프로그램을로드하려고했습니다.

Lib는 디렉토리에 존재하며 System.Drawing 및 mscorlib에만 의존합니다.

일반적으로 AppDomain.Current.AssemblyResolve예외가 발생하면 예외를 첨부 하거나 확인합니다. 미리로드하는 동안 예외가 발생하기 때문에 Azure에서는이 작업을 수행 할 수 없습니다.

    [BadImageFormatException: Could not load file or assembly 'Lib' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +34
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +16
   System.Reflection.Assembly.Load(String assemblyString) +28
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38

[ConfigurationErrorsException: Could not load file or assembly 'Lib' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +736
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
   System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +91
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +284
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +153
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +521

[HttpException (0x80004005): Could not load file or assembly 'Lib' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9930568
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

이 문제를 가로 채기 위해 사용자 지정 어셈블리 로더를 재정의 / 생성하는 방법이 있습니까?

나는 완전한 손실에 처해 있습니다.

감사

스티브

스티븐 예이츠

나는 이것을 할 때 그것을 싫어한다. 하루 종일 노력했기 때문에 질문을 게시하고 10 분 후에 수정합니다.

그래서 많은 도움이 될 핵심 정보를 놓친 것 같습니다.

BadImageFormatException

이것은 (내가 말할 수있는 한) PLATFORM (아키텍처) 호환성 (x86, x64)에 문제가있을 때 발생합니다. 내 모든 프로젝트는 "모든 CPU"용으로 컴파일되었습니다 ( 프로젝트 속성> 빌드> 플랫폼 대상, VS2013에서 찾을 수 있음 ).

그러나 내 "Lib"프로젝트는 x64 전용으로 구축되었으며 Azure 웹 사이트는 32 비트 모드에서 실행되었으므로 64 비트 dll을로드 할 수 없습니다.

두 가지 옵션 :

  1. "Lib"dll을 AnyCPU 또는 32 비트로 컴파일 한 다음 다시 게시하십시오.
  2. Azure 웹 사이트를 64 비트로 전환합니다.

"Lib"dll이 64 비트로 필요하기 때문에 옵션 2를 사용하지 않았습니다.

따라서 다른 사람이 이와 같은 것을 가지고있는 경우 향후 참조를 위해 다음을 확인하십시오.

  1. Azure 웹 사이트 플랫폼 ( 이전 포털의 구성> 플랫폼 아래에 있음 )
  2. 모든 프로젝트가 CPU 또는 호환 가능한 "플랫폼 (아키텍처)"에 대해 설정되어 있는지 확인하십시오.

다른 사람에게 도움이되기를 바랍니다.

감사

스티브

편집 : 다른 사람이이 문제가있을 수있는 향후 사람들을 위해 추가 할 유용한 정보가 있다면 그렇게하십시오.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

IIS 웹 사이트. 파일 또는 어셈블리를로드 할 수 없습니다.

Unittest 프로젝트 Azure Functions가 'Newtonsoft.Json'파일 또는 어셈블리를로드 할 수 없습니다.

Azure Functions를 사용하여 System.Fabric 파일 또는 어셈블리를로드 할 수 없습니다.

파일 또는 어셈블리 Windows.winmd를로드 할 수 없습니다. '

SSIS 웹 서비스 작업에서 파일 또는 어셈블리 오류를로드 할 수 없습니다.

파일 또는 어셈블리 'Microsoft.Azure.Documents.Client-Azure-Table-Api를로드 할 수 없습니다.

Azure 일괄 작업 오류 : 파일 또는 어셈블리를로드 할 수 없습니다. 'Microsoft.Data.OData

Azure devops의 Docker 빌드가 파일 또는 어셈블리 'Microsoft.CodeAnalysis를 로드할 수 없습니다.

Azure 함수 예외가 ActiveDirectory 파일 또는 어셈블리를로드 할 수 없습니다.

Azure 함수 : Newtonsoft.Json 파일 또는 어셈블리를로드 할 수 없습니다.

클래스 라이브러리를 참조하는 azure 함수에서 파일 또는 어셈블리 'System.Data.Entity 4.0.0.0'을 로드할 수 없습니다.

파일 또는 어셈블리 'Microsoft.WindowsAzure.Storage'Azure Functions를로드 할 수 없습니다.

Azure의 오류 : 파일 또는 어셈블리 NuGet.Core를로드 할 수 없습니다.

Azure Web App-파일 또는 어셈블리를로드 할 수 없습니다. Microsoft.SqlServer.Types

Azure 연속 배포 오류 파일 또는 어셈블리를로드 할 수 없습니다. Microsoft.WindowsAzure.Packaging

Azure에 배포 한 후 파일 또는 어셈블리 'System.IdentityModel.Tokens.Jwt를로드 할 수 없습니다.

Azure Functions 앱에서 파일 또는 어셈블리 Microsoft.EntityFrameworkCore 오류를로드 할 수 없습니다.

Azure의 오류 : 파일 또는 어셈블리 NuGet.Core를로드 할 수 없습니다.

Azure Functions - 파일 또는 어셈블리 ''AzureFunctions.Autofac.Shared'를 로드할 수 없습니다.

오류: 파일 또는 어셈블리 'Microsoft.Azure.WebJobs.Script.Abstractions를 로드할 수 없습니다.

서버에 배포 Azure 에이전트 설치 실패 : System.IO.FileNotFoundException : 파일 또는 어셈블리를로드 할 수 없습니다. 'DotNetAgent, 버전 = 1.0.0.0

Azure 파이프 라인 작업 VSTest @ 2 오류로 인해 실패-파일 또는 어셈블리 'Microsoft.VisualStudio.TestPlatform.Common.resources'를로드 할 수 없습니다.

Azure-기본 페이지로 리디렉션되지 않고 "파일 또는 어셈블리 'DotNetOpenAuth.Core'를로드 할 수 없습니다."오류 표시

이 오류를 수정하는 방법 "Microsoft.Extensions.Azure: 파일 또는 어셈블리 'System.Diagnostics.Tracing, 버전=5.0.0.0을 로드할 수 없습니다.'

Azure Functions, 파일 또는 어셈블리를로드 할 수 없음

프로젝트 참조를 위해 파일 또는 어셈블리를로드 할 수 없습니다.

파일 또는 어셈블리 'Microsoft.SqlServer.Types를 로컬 복사로로드 할 수 없습니다.

CRM에서 파일 또는 어셈블리를 프로젝트에로드 할 수 없습니다.

WCF 서비스를 사용하여 파일 또는 어셈블리를로드 할 수 없습니다.

TOP 리스트

  1. 1

    Ionic 2 로더가 적시에 표시되지 않음

  2. 2

    JSoup javax.net.ssl.SSLHandshakeException : <url>과 일치하는 주체 대체 DNS 이름이 없습니다.

  3. 3

    std :: regex의 일관성없는 동작

  4. 4

    Xcode10 유효성 검사 : 이미지에 투명성이 없지만 여전히 수락되지 않습니까?

  5. 5

    java.lang.UnsatisfiedLinkError : 지정된 모듈을 찾을 수 없습니다

  6. 6

    rclone으로 원격 디렉토리의 모든 파일을 삭제하는 방법은 무엇입니까?

  7. 7

    상황에 맞는 메뉴 색상

  8. 8

    SMTPException : 전송 연결에서 데이터를 읽을 수 없음 : net_io_connectionclosed

  9. 9

    정점 셰이더에서 카메라에서 개체까지의 XY 거리

  10. 10

    Windows cmd를 통해 Anaconda 환경에서 Python 스크립트 실행

  11. 11

    다음 컨트롤이 추가되었지만 사용할 수 없습니다.

  12. 12

    C #에서 'System.DBNull'형식의 개체를 'System.String'형식으로 캐스팅 할 수 없습니다.

  13. 13

    JNDI를 사용하여 Spring Boot에서 다중 데이터 소스 구성

  14. 14

    Cassandra에서 버전이 지정된 계층의 효율적인 모델링

  15. 15

    복사 / 붙여 넣기 비활성화

  16. 16

    Android Kotlin은 다른 활동에서 함수를 호출합니다.

  17. 17

    Google Play Console에서 '예기치 않은 오류가 발생했습니다. 나중에 다시 시도해주세요. (7100000)'오류를 수정하는 방법은 무엇입니까?

  18. 18

    SQL Server-현명한 데이터 문제 받기

  19. 19

    Seaborn에서 축 제목 숨기기

  20. 20

    ArrayBufferLike의 typescript 정의의 깊은 의미

  21. 21

    Kubernetes Horizontal Pod Autoscaler (HPA) 테스트

뜨겁다태그

보관