[英]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.