我已按照此tutorial將.NET Core控制檯應用程序部署到Azure Web Service WebJob。將.NET Core控制檯應用程序部署到Azure時加載hostpolicy.dll時出錯WebJobs
我的應用程序沒有任何問題,在本地運行(與DOTNET 1.0.0-preview2-003131),但是當我嘗試從Azure的控制檯運行它,我有以下錯誤:
無法加載從dll的[d:\本地\ VirtualDirectory0 \網站\ wwwroot的\ app_data文件\ \工作觸發\ PopcornExportWebJob \ hostpolicy.dll] HRESULT:0x800700C1
時發生錯誤,同時從[d加載所需的庫hostpolicy.dll: \ local \ VirtualDirectory0 \ site \ wwwroot \ app_data \ jobs \ triggered \ PopcornExportWebJob]
Azure dotnet的版本是1.0.0-rc4-004771並且hostpolicy.dll文件與我在本地使用的版本相同。事實上,當我從Azure下載部署的zip文件並在本地運行它時,它工作正常。但它在Azure環境中失敗。
而且,這裏是我的project.json:
{
"publishOptions": {
"include": [
"run.cmd"
]
},
"buildOptions": {
"emitEntryPoint": true,
"copyToOutput": "appsettings.json"
},
"copyright": "bbougot",
"dependencies": {
"FubarCoder.RestSharp.Portable.Core": "4.0.7",
"FubarCoder.RestSharp.Portable.HttpClient": "4.0.7",
"Microsoft.ApplicationInsights.AspNetCore": "2.0.0",
"Microsoft.Extensions.Configuration": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"Microsoft.Extensions.DependencyInjection": "1.1.0",
"Microsoft.Extensions.Logging": "1.1.0",
"Microsoft.Extensions.Logging.Console": "1.1.0",
"Microsoft.NETCore.App": "1.1.0",
"MongoDB.Driver": "2.4.2",
"StructureMap.Microsoft.DependencyInjection": "1.3.0"
},
"description": "Popcorn Api Exporter",
"frameworks": {
"netcoreapp1.1": {
"imports": [
"portable-net45+win8"
]
}
},
"runtimes": {
"win10-x64": {}
},
"scripts": {
"postpublish": [ "7za.exe a -tzip PopcornExport.zip .\\bin\\Release\\PublishOutput\\*",
".\\WAWSDeploy.exe .\\PopcornExport.zip .\\popcornexport.PublishSettings /t app_data\\jobs\\triggered\\PopcornExportWebJob /v /d" ]
},
"title": "PopcornExport",
"version": "1.0.0-*"
}
我不得不添加節點運行時(win10-64,否則應用程序無法在本地運行)。但是,Azure Web Service正在Windows Server 2012上運行。可能會有問題嗎?
我錯過了什麼?
類似的問題[庫豪stpolicy.dll未找到](// stackoverflow.com/q/38085430) –