当前位置:网站首页>[continuous update] C # common problems and their solutions (vs2019)
[continuous update] C # common problems and their solutions (vs2019)
2022-04-21 18:53:00 【STARBLOCKSHADOW】
Catalog
VS2019 error :CS8370 function “ Top level statement ” stay C#7.3 Unavailable in . Please use 9.0 Or higher .
error :

reason : top (Top-level) The statement is in C# 9 Features added in . stay C# 9 Before , The entry point is named Main Static method of .
solve :
In order to enable C#9.0, You need to edit .csproj File and add the following :
<PropertyGroup>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
perhaps , You can use the following configuration to the latest C# edition ( At present, it is 11.0) Target :
<PropertyGroup>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Open... Under the project file directory .csproj file (xml Format )
find <PropertyGroup> Node under <LangVersion>, Change its value to 9.0.
Without this byte point , It's in <PropertyGroup> Under the node ,<WarningLevel> After node , Add... Directly <LangVersion> node :

After reloading the project , There is no wrong report , The problem has been solved :

The reason why the console program flashed by
problem : In the menu bar “ start-up ” Button or press the keyboard directly “F5” key , Found that the program is running , But I haven't seen what the console shows yet , The console closes automatically .
reason :F5 yes Debugging Pattern , In this mode , When the program is finished , The window will not remain open . and Ctrl+F5 yes Start Without Debugging Pattern , In this mode , You can see the results .
solve : Press “Ctrl+F5” Key operation .
CS7022 The entry point of the program is the global code ; Will ignore "TestClass.Main(string[])" entry point .
problem : If you use top-level program functions , No more Main As the entry point of the program , If you write, you won't report an error , There will be a warning , The program automatically ignores .
solve : take Main Entry point deleted .
版权声明
本文为[STARBLOCKSHADOW]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211846372326.html
边栏推荐
- 数据库进阶学习:索引分类和创建语法
- What kind of Bluetooth headset is inexpensive and practical? Wireless Bluetooth headset for student party
- Null和Undefined的区别
- LeetCode1765. 地图中的最高点(BFS)
- 少儿编程培训发展的重要趋势
- 这玩意叫跳表?
- 【js学习笔记四十一】单体模式
- 有什么蓝牙耳机不贵又实用?适合学生党的无线蓝牙耳机
- CVPR2022 Oral | CosFace、ArcFace的大统一升级,AdaFace解决低质量图像人脸识
- 无线蓝牙耳机哪款比较好用?2022蓝牙耳机推荐
猜你喜欢

Excel表格快速生成LaTeX

Niu Ke - alternative addition

央行明确2022年支付监管工作重点,各平台企业要注意二清风险

Which wireless Bluetooth headset is easier to use? 2022 Bluetooth headset recommendations

Finally, wechat scanning code login is completed. It's really fragrant..

Teach you how to build components and applications by hand

86 r K-means, hierarchy, EM clustering introduction

This thing is called a jump watch?

The Renaissance of digital art, the exploration and rise of Digital Collections

低密度脂蛋白研究丨LDL-C含量检测试剂盒方案
随机推荐
Gateway decryption recommended by large manufacturers: introduction to the function module of fizz gateway background management system
spfa判断是否存在负环
ubutnu安装go
Ubuntu install go
奇安信监控设备 --- 椒图
T-SQL language of SQL Server database
SVG系列——1,入门级操作
Dry goods | after the interview, how to talk about salary? What are the skills of a high paying offer?
Read the meaning of seek tiger's launch of Genesis node
无线蓝牙耳机哪个品牌好?无线蓝牙耳机推荐
牛客 - 另类加法
Which brand of wireless Bluetooth headset is good? Wireless Bluetooth headset recommendation
Typescript quick start, class, public, private, extensions
How to view the zskiplist structure in redis source code
Crystal Chem活性 GIP ELISA 试剂盒说明书
Splicing method of fields in MySQL database and Oracle Database
[games101] assignment 5: simple ray tracing and framework understanding
Kotlin | these things you should know about lazy
一文读懂PlatoFarm新经济模型以及生态进展
MySQL的吞吐量