Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net core IIS 10上的.NET MVC Core 2部署问题_Asp.net Core_Windows Server 2016_Iis 10 - Fatal编程技术网

Asp.net core IIS 10上的.NET MVC Core 2部署问题

Asp.net core IIS 10上的.NET MVC Core 2部署问题,asp.net-core,windows-server-2016,iis-10,Asp.net Core,Windows Server 2016,Iis 10,我正在尝试将我的ASP.NET MVC Core 2部署到运行IIS 10的Windows Server 2016服务器上,应用程序日志中出现以下错误 我研究了这个问题,发现这个问题的答案是:“由于VS2017 RC附带了新版本的.NET Core SDK(.NET Core 1.0.4 SDK 1.0.1),您还需要在服务器上更新framework。” 我已尝试按照上面的回答在服务器上安装SDK和运行时,但当我导航到该站点时仍然收到错误。 我如何解决这个问题 Faulting applicat

我正在尝试将我的ASP.NET MVC Core 2部署到运行IIS 10的Windows Server 2016服务器上,应用程序日志中出现以下错误

我研究了这个问题,发现这个问题的答案是:“由于VS2017 RC附带了新版本的.NET Core SDK(.NET Core 1.0.4 SDK 1.0.1),您还需要在服务器上更新framework。”

我已尝试按照上面的回答在服务器上安装SDK和运行时,但当我导航到该站点时仍然收到错误。

我如何解决这个问题

Faulting application name: dotnet.exe, version: 2.0.25816.2, time stamp: 0x59e535ea
Faulting module name: coreclr.dll, version: 4.6.25815.2, time stamp: 0x59e2b767
Exception code: 0xc00000fd
Fault offset: 0x000000000008247a
Faulting process id: 0x1c68
Faulting application start time: 0x01d36aeaea2429cf
Faulting application path: C:\Program Files\dotnet\dotnet.exe
Faulting module path: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.3\coreclr.dll
Report Id: 100b3c83-7509-487e-b1cd-6a0357f8b7e7
Faulting package full name: 
Faulting package-relative application ID: 

运行以下命令显示了真正的错误:

C:\Windows\system32>"C:\Program Files\dotnet\dotnet" C:\inetpub\wwwroot\{YOUR_IIS_SITE_NAME}\{YOUR_PROJECT_NAME}.dll
命令提示符中的结果如下,它告诉我连接字符串中有错误:

C:\Windows\system32>"C:\Program Files\dotnet\dotnet" C:\inetpub\wwwroot\www_projectx_com\ProjectX.dll
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
      User profile is available. Using 'C:\Users\darchual\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[58]
      Creating key {70b30c91-49df-45be-95cc-2e681b5cde76} with creation date 2017-12-04 16:34:08Z, activation date 2017-12-04 16:34:08Z, and expiration date 2018-03-04 16:34:08Z.
info: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[39]
      Writing data to file 'C:\Users\darchual\AppData\Local\ASP.NET\DataProtection-Keys\key-70b30c91-49df-45be-95cc-2e681b5cde76.xml'.

Unhandled Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: connectionString
   at Microsoft.EntityFrameworkCore.Utilities.Check.NotEmpty(String value, String parameterName)
   at Microsoft.EntityFrameworkCore.SqlServerDbContextOptionsExtensions.UseSqlServer(DbContextOptionsBuilder optionsBuilder, String connectionString, Action`1 sqlServerOptionsAction)
   at ProjectX.Startup.<ConfigureServices>b__4_0(DbContextOptionsBuilder options) in C:\VSO\Avvenire Source\Internal\Project X\ProjectX\Startup.cs:line 35
   ... truncated for brevity ...

参考

这看起来很有用,但它假设代码中有一个bug@Grantly我没有收到任何stackoverflow错误。但是您收到了以下异常代码:0xc00000fd(您尝试过重新安装吗?可能您尝试过,只是想问一下)嗨,Grantly。我终于发现了这个问题,并在下面发布了我的答案。非常感谢您的帮助:)
public class Program
{
    public static void Main(string[] args)
    {
        BuildWebHost(args).Run();
    }

    public static IWebHost BuildWebHost(string[] args) =>
        WebHost.CreateDefaultBuilder(args)
            .UseIISIntegration()
            .UseStartup<Startup>()
            .Build();
}
"ConnectionStrings": {
    "DefaultConnection": "Server={theserver};Database={thedatabase};MultipleActiveResultSets=true;User Id={theusername};Password={thepassword};"
},