ASP.NET Core 0x80004005

后端 未结 2 1536
悲&欢浪女
悲&欢浪女 2021-01-19 20:59

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.

I can build and run the project lo

相关标签:
2条回答
  • 2021-01-19 21:13

    Turns out that this was result of needing to install some windows updates and this problem:

    api-ms-win-crt-runtime-l1-1-0.dll is missing when opening Microsoft Office file

    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:

    In project.json remove "type":"platform" from the dependencies:

    "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.1"     
    },
    

    Then define the Windows 12 R2 runtime:

    "runtimes": {
       "win81-x64": {}
    },
    

    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
    

    The standalone app should be created in the folder \bin\Release\netcoreapp1.1\win81-x64.

    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".

    From there google!

    After doing all this I was able to run my Website from IIS.

    0 讨论(0)
  • 2021-01-19 21:25

    This issue is related to Windows updates - but if you are in a similar environment than I was (where you are unable to just install ALL updates), these are the 2 that fixed the issue for me:

    I had the same error in question - and got nasty error message when typing 'dotnet' into CMD:

    The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing

    I solved this by manually installing the following 2 updates on Windows Server 2012 R2 (and the pre-requisites and all the other updates linked - read the installation instructions carefully on the Microsoft website):

    1. KB2919355
    2. KB2999226

    Hope this helps someone.

    0 讨论(0)
提交回复
热议问题