ASP.NET Core 0x80004005 [英] ASP.NET Core 0x80004005
问题描述
我是ASP.NET Core的新手,我试图将基本的ASP.NET Core Web应用程序部署到Windows 2012 R2服务器。
I am new to ASP.NET core and I am trying to just get the basic ASP.NET Core Web Application to deploy to a Windows 2012 R2 server.
我可以使用Visual Studio Express在本地构建和运行项目,但是当我部署到服务器时,出现502.5错误,确切的代码是(0x80004005)。
I can build and run the project locally using Visual Studio express but when I deploy to the server I get a 502.5 error, the exact code is (0x80004005).
日志文件为空,并且事件查看器仅提供了上述错误代码以外的信息。
The log files are blank and the Event Viewer gives no more information than just the above error code.
我怀疑我的Project.json文件出了点问题,如下所示:
I suspect there is something wrong with my Project.json file which looks like this:
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.1",
"type": "platform"
},
"Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.1",
"Microsoft.AspNetCore.Routing": "1.0.1",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"**/*.cshtml",
"appsettings.json",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
这是默认的project.json文件
This is the default project.json file generated by Visual Studio.
推荐答案
原来,这是由于需要安装一些Windows更新和以下问题导致的:
Turns out that this was result of needing to install some windows updates and this problem:
打开Microsoft Office文件时缺少api-ms-win-crt-runtime-l1-1-0.dll
我没有安装上一期中讨论的版本,而是磨入程序和功能并在Microsoft Visual C ++ 2015 Redistributable上进行了修复。
Rather than install the version discussed in the above issue I whet into Programs and Features and ran a repair on Microsoft Visual C++ 2015 Redistributable.
我的方式发现这个错误或者通过执行以下步骤将网站转换为独立的可执行文件:
The way I found this error was to convert the website to a standalone executable by performing the following steps:
在project.json中,从依赖项中删除 type: platform:
In project.json remove "type":"platform" from the dependencies:
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.1"
},
然后定义Windows 12 R2运行时:
Then define the Windows 12 R2 runtime:
"runtimes": {
"win81-x64": {}
},
然后在Website文件夹(包含project.json文件的文件夹)中,从命令提示符处运行以下命令:
Then in the Website folder (the folder containing the project.json file) run the following commands from the command prompt:
dotnet build -r win81-x64
dotnet publish -c release -r win81-x64
应在文件夹\bin\Release\netcoreapp1.1\win81-x64中创建独立应用程序。
The standalone app should be created in the folder \bin\Release\netcoreapp1.1\win81-x64.
将此复制到服务器,然后运行它,将出现一个对话框,并显示类似 api-ms-win-crt-runtime-l1-1-0的消息.dll丢失。
Copy this to the server and then run it, a dialog should appear with a message similar to "api-ms-win-crt-runtime-l1-1-0.dll is missing".
从那里google!
完成所有这些操作后,我可以运行我的来自IIS的网站。
After doing all this I was able to run my Website from IIS.
这篇关于ASP.NET Core 0x80004005的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!