当前位置:网站首页>In Net 6 project using startup cs
In Net 6 project using startup cs
2022-07-03 03:47:00 【Dotnet cross platform】

about .NET 6 project , Now I can't find Startup.cs file . By default , This file has been deleted , also Program.cs Is to configure dependency injection services and Middleware New location for .
however , Some people may prefer to use Startup.cs , And I am also , Maybe I'm used to it , So in this article , I will be in .NET 6 Add to the project Startup.cs.
Use .NET 6 project , Program.cs The file will probably look like this , Adding services and using middleware are among them .

Now? , Let's add one manually Startup.cs file , And write the following code

We should all be familiar with these codes , Which includes ConfigureService() and Configure() Method , And added some services , And the use of middleware .
Next , We need to change it Program.cs file , Use our new Startup.cs.

It looks good ! Compared with before , It has become very concise !
Of course , You can also use other method names , For example ConfigureService Switch to RegisterServices, hold
Configure Switch to SetupMiddleware, as follows

Now? , Familiar old friends Startup.cs Back again !
END

边栏推荐
- Error c2694 "void logger:: log (nvinfer1:: ilogger:: severity, const char *)": rewrite the restrictive exception specification of virtual functions than base class virtual member functions
- [national programming] [software programming - Lecture Video] [zero foundation introduction to practical application]
- Pytoch lightweight visualization tool wandb (local)
- Without sxid, suid & sgid will be in danger- Shangwen network xUP Nange
- Learning notes of C programming [compiled by Mr. Tan Haoqiang] (Chapter III sequence programming) 04 C sentence
- 403 error displayed when vs cloning
- Limit of one question per day
- Positioning (relative positioning, absolute positioning, fixed positioning, Z-index) 2022-2-11
- Summary of determinant knowledge points in Chapter 1 of Linear Algebra (Jeff's self perception)
- Dynamic programming: Longest palindrome substring and subsequence
猜你喜欢

Summary of determinant knowledge points in Chapter 1 of Linear Algebra (Jeff's self perception)

PHP generates PDF tcpdf

leetcode:动态规划模板

没有sXid,suid&sgid将进入险境!-尚文网络xUP楠哥

Makefile demo
![C programming learning notes [edited by Mr. Tan Haoqiang] (Chapter III sequence programming) 03 operators and expressions](/img/4a/1df03d9f3315debb4c335260ed39f2.jpg)
C programming learning notes [edited by Mr. Tan Haoqiang] (Chapter III sequence programming) 03 operators and expressions

ffmpeg下载安装教程及介绍

Bid farewell to artificial mental retardation: Mengzi open source project team received RMB 100 million financing to help NLP develop

Nanning water leakage detection: warmly congratulate Guangxi Zhongshui on winning the first famous brand in Guangxi

For instruction, uploading pictures and display effect optimization of simple wechat applet development
随机推荐
pytorch是什么?pytorch是一个软件吗?
Filter
Limit of one question per day
FileZilla client download and installation
Summary of electromagnetic spectrum
[combinatorics] brief introduction to generating function (definition of generating function | Newton binomial coefficient | commonly used generating function | correlation with constant | correlation
How to move towards IPv6: IPv6 Transition Technology - Shangwen network quigo
Makefile demo
静态网页 和 动态网页的区别 & WEB1.0和WEB2.0的区别 & GET 和 POST 的区别
8.8.2-PointersOnC-20220214
Separable bonds and convertible bonds
Pytorch轻量级可视化工具wandb(local)
Download and install node, NPM and yarn
[leetcode question brushing day 34] 540 Unique element in array, 384 Disrupt array, 202 Happy number, 149 Maximum number of points on a line
Advanced redis applications [password protection, data persistence, master-slave synchronization, sentinel mode, transactions] [not completed yet (semi-finished products)]
pytorch难学吗?如何学好pytorch?
The calculation of stripe, kernel and padding in CNN
Ansible introduction [unfinished (semi-finished products)]
Pytorch multi card distributed training distributeddataparallel usage
Web会话管理安全问题