C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
Java
Learn iOS Programming
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
1
Reply
What Configure() method does in Startup.cs?
Rajesh Gami
7y
3.3k
0
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
The Configure method is used to specify how the ASP.NET application will respond to HTTP requests. The request pipeline is configured by adding middleware components to an IApplicationBuilder instance that is provided by dependency injection. There are some built-in middlewares for error handling, authentication, routing, session and diagnostic purpose. Highlighted lines in below code, are built-in Middleware with ASP.NET Core 1.0.public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) {loggerFactory.AddConsole(Configuration.GetSection("Logging"));loggerFactory.AddDebug();app.UseApplicationInsightsRequestTelemetry();if (env.IsDevelopment()){app.UseBrowserLink();app.UseDeveloperExceptionPage();}else{app.UseExceptionHandler("/Home/Error");// For more details on creating database during deployment see http://go.microsoft.com/fwlink/?LinkID=615859try{using (var serviceScope = app.ApplicationServices.GetRequiredService
().CreateScope()){serviceScope.ServiceProvider.GetService
().Database.Migrate();}}catch { }}app.UseIISPlatformHandler(options => options.AuthenticationDescriptions.Clear());app.UseStaticFiles();app.UseIdentity();// To configure external authentication please see http://go.microsoft.com/fwlink/?LinkID=532715app.UseMvc(routes =>{routes.MapRoute(name: "default",template: "{controller=Home}/{action=Index}/{id?}");}); }
Rajesh Gami
7y
0
What ConfigureServices() method does in Startup.cs?
What is Kestral?
Message