【.Net Core】using declarations‘ is not available in C# 7.3. Please use language version 8.0 or greate

前言

在使用.net core3.0的时候,代码中使用了using声明后,出现了“Using 声明在 C# 7.3 中不可用。请使用 8.0 或更高的语言版本。”的错误提示,解决方案如下

错误信息 

Severity

Code

Description

Project

File

Line

Suppression State

Error

CS8370

Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater.

CNPCApi

D:\Project\NetCore\CNPCApi\CNPCApi\Program.cs

14

Active

解决方案

在解决方案文件 .csproj(在资源管理器中右键通过vs打开进行编辑)文件中添加如下属性节点

<PropertyGroup>
   <LangVersion>preview</LangVersion>
</PropertyGroup>
或
<PropertyGroup>
   <LangVersion>8.0</LangVersion>
</PropertyGroup>

添加完成后保存,重新编译成功,哦了

 

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
一个很强大的工具, 能将c#代码片段、文件甚至工程直接转换成java代码,并能彻底解决外部引用的DLL问题,最强的是支持c#工程的直接转换,生成的Java代码质量也很不错。软件已破解,去除了未注册版最多只能转换1000行的限制,亲测可用!压缩包内含帮助文档,不过由于软件的使用很简单,帮助文档基本可以忽略。(小提示:如无法运行,请确认是否安装了.NET framework) 下面是一些英文介绍: C# to Java Converter features include: 1. Folder conversion: Entire folders of C# code files are converted to Java code files.(文件夹转换) 2. Code snippet and file conversion: Our snippet conversion accuracy is outstanding and does not require you to insert entire methods or classes. Heuristics are used to convert code fragments wit h missing declarations. (代码片段和文件转换) 3. Full support for the latest .NET code syntax: Generics and other newer C# features are converted where possible to the Java equivalent.(全面支持最新版的.NET语法) 4. Conversion options: You can specify numerous conversion options via our Options dialog. Code formatting options, custom type & member replacements, custom string replacements, and miscellaneous options. (可以指定转换规则) 5. File comparison feature: After converting a project or folder, you can compare original and converted files side-by-side. Comparing converted code to original code.(原代码与转换后代码的比较) 6. Running from the command line: C# to Java Converter can be launched directly for a specific project, folder, or file conversion from the command line. Command line.(命令行执行) 其他一些特点: 1. Converts all versions of C# code (2002, 2003, 2005, 2008, and 2010) (可以转换所有版本的C#代码) 2. Evaluates all referenced assemblies and .NET projects in order to resolve external references more completely.(能彻底解决外部引用的dll类库) 3. Converts C# ref parameters using Java generics 4. Superb conversions of all types of arrays 5. Handles the numerous coding alternatives and ambiguities of C# code 6. Flawless conversion of all aspects of inheritance and interfaces 7. Allows custom replacement of strings in the final converted code 8. Accurate even with poorly formatted C# code
Contents iii Preface v Preface to the Fourth Edition ...................................................... v Preface to the Third Edition ........................................................ ix Preface to the Second Edition ..................................................... xi Preface to the First Edition ......................................................... xii Part I: Introductory Material 1. Notes to the Reader ..................................................................... 3 2. A Tour of C++: The Basics ......................................................... 37 3. A Tour of C++: Abstraction Mechanisms ................................... 59 4. A Tour of C++: Containers and Algorithms ............................... 87 5. A Tour of C++: Concurrency and Utilities ................................. 111 Part II: Basic Facilities 133 6. Types and Declarations ............................................................... 135 7. Pointers, Arrays, and References ................................................ 171 8. Structures, Unions, and Enumerations ........................................ 201 9. Statements ................................................................................... 225 10. Expressions ................................................................................. 241iv Contents 11. Select Operations ........................................................................ 273 12. Functions ..................................................................................... 305 13. Exception Handling .................................................................... 343 14. Namespaces ................................................................................. 389 15. Source Files and Programs .......................................................... 419 Part III: Abstraction Mechanisms 447 16. Classes ........................................................................................ 449 17. Construction, Cleanup, Copy, and Move .................................... 481 18. Overloading ................................................................................. 527 19. Special Operators ........................................................................ 549 20. Derived Classes ........................................................................... 577 21. Class Hierarchies ........................................................................ 613 22. Run-Time Type Information ....................................................... 641 23. Templates .................................................................................... 665 24. Generic Programming ................................................................. 699 25. Specialization .............................................................................. 721 26. Instantiation ................................................................................ 741 27. Templates and Hierarchies .......................................................... 759 28. Metaprogramming ....................................................................... 779 29. A Matrix Design ......................................................................... 827 Part IV: The Standard Library 857 30. Standard Library Summary ......................................................... 859 31. STL Containers ........................................................................... 885 32. STL Algorithms .......................................................................... 927 33. STL Iterators ............................................................................... 953 34. Memory and Resources ............................................................... 973 35. Utilities ........................................................................................ 1009 36. Strings ......................................................................................... 1033 37. Regular Expressions .................................................................... 1051 38. I/O Streams ................................................................................. 1073 39. Locales ........................................................................................ 1109 40. Numerics ..................................................................................... 1159 41. Concurrency ................................................................................ 1191 42. Threads and Tasks ....................................................................... 1209
Title: Learn C++ Programming Language: Become A Complete C++ Programmer Author: Virender Singh Length: 1018 pages Edition: 1 Language: English Publication Date: 2015-10-01 This Book Teaches C++ In Details. This Is The Complete Book To Learn C++. The Best Book To Learn C++. Become A Complete C++ Programmer By Learning This Awsome Book. Table of Contents Part I: Introductory Material Chapter 1. Notes to the Reader Chapter 2. A Tour of C++: The Basics Chapter 3. A Tour of C++: Abstraction Mechanisms Chapter 4. A Tour of C++: Containers and Algorithms Chapter 5. A Tour of C++: Concurrency and Utilities Part II: Basic Facilities Chapter 6. Types and Declarations Chapter 7. Pointers, Arrays, and References Chapter 8. Structures, Unions, and Enumerations Chapter 9. Statements Chapter 10. Expressions Chapter 11. Select Operations Chapter 12. Functions . 305 Chapter 13. Exception Handling Chapter 14. Namespaces Chapter 15. Source Files and Programs Part III: Abstraction Mechanisms Chapter 16. Classes Chapter 17. Construction, Cleanup, Copy, and Move Chapter 18. Overloading Chapter 19. Special Operators Chapter 20. Derived Classes Chapter 21. Class Hierarchies Chapter 22. Run-Time Type Information Chapter 23. Templates Chapter 24. Generic Programming Chapter 25. Specialization Chapter 26. Instantiation Chapter 27. Templates and Hierarchies Chapter 28. Metaprogramming Chapter 29. A Matrix Design Part IV: The Standard Library Chapter 30. Standard Library Summary Chapter 31. STL Containers Chapter 32. STL Algorithms Chapter 33. STL Iterators Chapter 34. Memory and Resources Chapter 35. Utilities Chapter 36. Strings Chapter 37. Regular Expressions Chapter 38. I/O Streams Chapter 39. Locales Chapter 40. Numerics Chapter 41. Concurrency Chapter 42. Threads and Tasks Chapter 43. The C Standard Library Chapter 44. Compatibility

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一起来学吧

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值