![](/img/trans.png)
[英]ASP.Net Core Web API works on IIS Express, but not working when deployed to IIS
[英]ASP.NET Core 5 Web API with Entity Framework works when running in IDE but not when published to folder and installed in IIS
我有这样一个令人沮丧的问题。 我已经使用 Entity Framework Core 编写了 ASP.NET Core 5 Web API。 这在我的开发机器上完美运行,如果我将项目复制到另一台机器,我可以简单地更新连接字符串,它也可以在那里运行。
每当我发布项目并尝试通过 IIS 访问它时。 我收到以下错误。
类别:Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer
事件编号:2
跨度 ID:f97ede8e15417a59
TraceId:7ebb4da21f77111ec887913667671c80
父 ID:0000000000000000
请求ID:80000017-0002-fe00-b63f-84710c7967bb
请求路径:/api/v1/users/auth连接 ID “18302628895834243094”,请求 ID “80000017-0002-fe00-b63f-84710c7967bb”:应用程序引发了未处理的异常。
例外:
System.PlatformNotSupportedException:Strings.PlatformNotSupported_DataSqlClient在 Microsoft.Data.SqlClient.SqlConnectionStringBuilder..ctor(字符串连接字符串)
在 Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.<>c.<get_IsMultipleActiveResultSetsEnabled>b__7_0(String cs)
在 System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func
2 valueFactory)
在 Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.get_IsMultipleActiveResultSetsEnabled()
This is my first time publishing a .net core app to IIS but I have followed a lot of guidance from the community and my swagger home page loads so this is definitely about SQL.
以下是我的发布资料。 无法弄清楚我做错了什么。
谢谢您的帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.