第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

我用的也是2.2,出現(xiàn)異常!

http://img1.sycdn.imooc.com//5e927d0000011ceb09890308.jpg

System.InvalidOperationException

? HResult=0x80131509

? Message=Unable to find the required services. Please add all the required services by calling 'IServiceCollection.AddMvc' inside the call to 'ConfigureServices(...)' in the application startup code.

? Source=Microsoft.AspNetCore.Mvc.Core

? StackTrace:

? ?at Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.VerifyMvcIsRegistered(IApplicationBuilder app)

? ?at Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.UseMvc(IApplicationBuilder app, Action`1 configureRoutes)

? ?at Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.UseMvcWithDefaultRoute(IApplicationBuilder app)

? ?at Lanzhoulamian.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env) in C:\Users\Administrator\Desktop\Lanzhoulamian\Lanzhoulamian\Startup.cs:line 27


正在回答

3 回答

?很強的學習能力!

0 回復 有任何疑惑可以回復我~

services.AddMvc(options => options.EnableEndpointRouting = false),添加這條確實可以解決該問題,謝謝!

0 回復 有任何疑惑可以回復我~

通過查找百度找到問題了!

在ASP.NET Core 2.2中,新增了一種路由,叫做Endpoint(終結點)路由。本文將以往的路由系統(tǒng)稱為傳統(tǒng)路由。

本文通過源碼的方式介紹傳統(tǒng)路由和Endpoint路由部分核心功能和實現(xiàn)方法,具體功能上的差異見官方文檔。

在升級到ASP.NET Core 2.2后,會自動啟用Endpoint路由

? ? ? public void ConfigureServices(IServiceCollection services)

? ? ? ? {

????????????//添加

? ? ? ? ? ? services.AddMvc(options => options.EnableEndpointRouting = false)

? ? .SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

? ? ? ? }


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

我用的也是2.2,出現(xiàn)異常!

我要回答 關注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號