2016-11-04 5 views
0

ネイティブの64ビットdllを使用するAzure Web API Appを作成しました。私は問題なくローカルにサービスを実行することができます。しかし、Azureでホストしようとすると、私は以下のエラーを受け取ります。Azure Appでネイティブ64ビットDLLを参照する

Azureアプリケーションの内部にネイティブDLLを読み込むことに関する既知の問題があるthreadがあります。私は解決策をたどり、binフォルダ(D:\ home \ site \ wwwroot \ bin)をPATHに追加するためのXDTスクリプトを作成しました。残念ながらそれは役に立たなかった。

私のdllがAzureポータルコンソールを使用してアプリケーションのbinフォルダにあることを確認しました。私はまた、Kuduで、私のアプリが更新されたパスを見ていることを確認しました。 Azure Portal内のアプリケーション設定が64ビットに設定されていることを確認しました。アプリケーションの設定を32ビットモードに戻すと、dllが見つかって間違った形式のエラーがスローされるので、Azureの内部に64ビットのネイティブdllを参照する問題があるようです。

私は私のアプリを呼び出すようにしようとすると、私は次のエラーを取得しています:

Server Error in '/' Application. 

    Could not load file or assembly 'My64Bit.DLL' or one of its dependencies. The specified module could not be found. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'My64Bit.DLL' or one of its dependencies. The specified module could not be found. 

    Source Error: 

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

    Stack Trace: 


    [FileNotFoundException: Could not load file or assembly 'My64Bit.DLL' or one of its dependencies. The specified module could not be found.] 
     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.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +234 
     System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +108 
     System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +25 
     System.Reflection.Assembly.Load(String assemblyString) +34 
     System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +49 

    [ConfigurationErrorsException: Could not load file or assembly 'My64Bit.DLL' or one of its dependencies. The specified module could not be found.] 
     System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +772 
     System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +259 
     System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +163 
     System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +230 
     System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +76 
     System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +343 
     System.Web.Compilation.BuildManager.ExecutePreAppStart() +176 
     System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +734 

    [HttpException (0x80004005): Could not load file or assembly 'My64Bit.DLL' or one of its dependencies. The specified module could not be found.] 
     System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +539 
     System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +125 
     System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +731 

答えて

1

問題は、[...]私はデバッグとしてDLLをコンパイルし、それらをVCRUNTIMEを参照するために発生したリリースしていなかったということでしたDとMSVCP [...] DはAzureで利用できないDLLをデバッグします。リリースでDLLを再コンパイルすると問題が解決しました。

関連する問題