亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

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

關于使用ASP.NET CORE 3.1 點擊無反應的 點進來看一下!??!

有問題的可以對照一下我的Starup.cs文件 主要是在endpoints里加一個MapRazorPages();

using System;

using System.Collections.Generic;

using System.Linq;

using System.Threading.Tasks;

using Microsoft.AspNetCore.Builder;

using Microsoft.AspNetCore.Hosting;

using Microsoft.AspNetCore.Http;

using Microsoft.Extensions.DependencyInjection;

using Microsoft.Extensions.Hosting;

using LanzhouBeefNoodles.Models;

using Microsoft.EntityFrameworkCore;

using Microsoft.Extensions.Configuration;

using Microsoft.AspNetCore.Identity;


namespace LanzhouBeefNoodles

{

? ? public class Startup

? ? {

? ? ? ? // This method gets called by the runtime. Use this method to add services to the container.

? ? ? ? // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940

? ? ? ? public IConfiguration Configuration { get; }

? ? ? ? public Startup(IConfiguration configuration)

? ? ? ? {

? ? ? ? ? ? Configuration = configuration;

? ? ? ? }

? ? ? ? public void ConfigureServices(IServiceCollection services)

? ? ? ? {

? ? ? ? ? ? services.AddDbContext<AppDbContext>(options =>

? ? ? ? ? ? ? ? options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))

? ? ? ? ? ? ? ? );

? ? ? ? ? ? services.AddMvc();

? ? ? ? ? ? services.AddRazorPages();

? ? ? ? ? ? services.AddTransient<INoodleRepository, NoodleRepository>();

? ? ? ? ? ? services.AddTransient<IFeedbackRepository, FeedbackRepository>();

? ? ? ? }


? ? ? ? // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.

? ? ? ? public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

? ? ? ? {

? ? ? ? ? ? if (env.IsDevelopment())

? ? ? ? ? ? {

? ? ? ? ? ? ? ? app.UseDeveloperExceptionPage();

? ? ? ? ? ? ? ??

? ? ? ? ? ? }

? ? ? ? ? ? app.UseHttpsRedirection();

? ? ? ? ? ? app.UseStaticFiles();? ? ? ?

? ? ? ? ? ? app.UseRouting();

? ? ? ? ? ? app.UseAuthentication();

? ? ? ? ? ? app.UseEndpoints(endpoints =>

? ? ? ? ? ? {

? ? ? ? ? ? ? ? endpoints.MapDefaultControllerRoute();

? ? ? ? ? ? ? ? endpoints.MapRazorPages();

? ? ? ? ? ? ? ??

? ? ? ? ? ? });

? ? ? ? }

? ? }

}


正在回答

2 回答

全部都復制過去了 還是沒用啊?


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

???謝謝,我也正在計劃把課程遷移至3.1。

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

舉報

0/150
提交
取消

關于使用ASP.NET CORE 3.1 點擊無反應的 點進來看一下?。。?/h1> 我要回答 關注問題

微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號