using Microsoft.Extensions.DependencyInjection; namespace netcore_mvc_templates { public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { /* An unhandled exception was thrown by the application. System.InvalidOperationException: No service for type 'Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionaryFactory' has been registered. Solution: Use AddMvc() instead of AddMvcCore() in Startup.cs and it will work. */ // services.AddMvcCore(); services.AddMvc(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { app.UseStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default",
推荐阅读
SQL Server 2017正式发布;Oracle宣布开源Fn project
SQL Server 2017 正式宣布:同时支撑 Windows 和 Linux微软在客岁 3 月初次对外宣布了 Linux 版的 SQL Server,痊愈本年 7 月宣布了首个公开 RC 版。前几日在美国奥兰多召开的微软 Ignit>>>详细阅读
本文标题:论HTTP性能,Go与.NET Core一争雌雄
地址:http://www.17bianji.com/lsqh/37756.html
1/2 1