[英]publish .net core and angular2 in iis
我有一個.net核心Web應用程序,其中有一些類庫作為我的層(數據層/業務層/ aspnetCore層),我在項目中使用了Angular2。 當我在iis中發布項目時,該部分被角調用webApi(以從Database sql server獲取信息),它不起作用。 並得到錯誤:“ ERR_Connection_Reset”
我做這些工作: https : //blog.3d-logic.com/2016/06/08/running-asp-net-core-applications-with-iis-and-antares/但沒有結果。
我該怎么辦?
您的模型可能具有循環引用。 Core不支持開箱即用的多對多方式,我發現手動創建模型而不創建循環引用很困難。
在這種情況下,請嘗試更改Startup.cs文件的ConfigureServices()
方法。 該行services.AddMvc();
應該更改為:
services.AddMvc()
.AddJsonOptions(options => options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.