{"id":21967,"date":"2019-02-27T11:59:23","date_gmt":"2019-02-27T18:59:23","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/dotnet\/?p=21967"},"modified":"2019-04-12T12:41:18","modified_gmt":"2019-04-12T19:41:18","slug":"an-update-to-c-versions-and-c-tooling","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/an-update-to-c-versions-and-c-tooling\/","title":{"rendered":"An update to C# versions and C# tooling"},"content":{"rendered":"<p>Starting with Visual Studio 2019 Preview 4 and RC, we&#8217;ll be adjusting how C# versions are treated in .NET tooling. The version of C# used by your project will now be determined by target framework.<\/p>\n<h2>Summary of changes<\/h2>\n<p>The most important change is that the version of C# used by tooling by default will be determined by the target framework of your project.<\/p>\n<p>Additionally, we are adding two new Language Version (LangVer) values: <strong>LatestMajor<\/strong> and <strong>Preview<\/strong>. Here\u2019s how they stack up compared with the currently supported list of values:<\/p>\n<table border=\"1\" cellpadding=\"5\">\n<thead>\n<tr style=\"height: 28px;\">\n<th style=\"height: 28px; width: 26.6289%; border-style: none;\">LangVersion<\/th>\n<th style=\"height: 28px; width: 118.249%; border-style: none;\">Meaning<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 26.6289%; border-style: none;\">ISO-1<\/td>\n<td style=\"height: 28px; width: 118.249%; border-style: none;\">C# 1.0\/1.2<\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 26.6289%; border-style: none;\">ISO-2<\/td>\n<td style=\"height: 28px; width: 118.249%; border-style: none;\">C# 2.0<\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 26.6289%; border-style: none;\">3<\/td>\n<td style=\"height: 28px; width: 118.249%; border-style: none;\">C# 3.0<\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 26.6289%; border-style: none;\">4<\/td>\n<td style=\"height: 28px; width: 118.249%; border-style: none;\">C# 4.0<\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 26.6289%; border-style: none;\">5<\/td>\n<td style=\"height: 28px; width: 118.249%; border-style: none;\">C# 5.0<\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 26.6289%; border-style: none;\">6<\/td>\n<td style=\"height: 28px; width: 118.249%; border-style: none;\">C# 6.0<\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 26.6289%; border-style: none;\">7<\/td>\n<td style=\"height: 28px; width: 118.249%; border-style: none;\">C# 7.0<\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 26.6289%; border-style: none;\">7.1<\/td>\n<td style=\"height: 28px; width: 118.249%; border-style: none;\">C# 7.1<\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 26.6289%; border-style: none;\">7.2<\/td>\n<td style=\"height: 28px; width: 118.249%; border-style: none;\">C# 7.2<\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 26.6289%; border-style: none;\">7.3<\/td>\n<td style=\"height: 28px; width: 118.249%; border-style: none;\">C# 7.3<\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 26.6289%; border-style: none;\">8.0<\/td>\n<td style=\"height: 28px; width: 118.249%; border-style: none;\">C# 8.0<\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 26.6289%; border-style: none;\">LatestMajor<\/td>\n<td style=\"height: 28px; width: 118.249%; border-style: none;\">Latest supported major C# language version<\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 26.6289%; border-style: none;\">Preview<\/td>\n<td style=\"height: 28px; width: 118.249%; border-style: none;\">Latest available preview C# language version<\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 26.6289%; border-style: none;\">Latest<\/td>\n<td style=\"height: 28px; width: 118.249%; border-style: none;\">Latest supported C# language version (including minor version)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>The meaning of \u201csupported C# language version\u201d differs based on target, and the default used is also determined by the target of your project.<\/p>\n<h2>How this works for .NET Core 3.0 and .NET Standard 2.1<\/h2>\n<p>C# 8.0 has been built with .NET Core 3.0 and .NET Standard 2.1 in mind. Many of its features only work on .NET Core 3.0. This means .NET Core 3.0 and .NET Standard 2.1 are the only .NET Core and .NET Standard versions where C# 8.0 is supported.<\/p>\n<h2>How this works for all other target frameworks<\/h2>\n<p>Because C# 8.0 has been built for .NET Core 3.0 and .NET Standard 2.1, it will not be supported outside of .NET Core 3.0 and any platform implementing .NET Standard 2.1.<\/p>\n<h2>Support and compatibility for preview features<\/h2>\n<p>This change means that C# 8.0 preview will be the default for .NET Core 3.0 preview in all .NET tools, including Visual Studio. The way to think about support in this world is slightly different than before. We distinguish support today along the following lines:<\/p>\n<ul>\n<li>Any C# 7.3 and lower feature or behavior is fully supported and fully compatible in any context (.NET Core 3.0, .NET Core 2.x, .NET Framework, etc.). No change from what exists today.<\/li>\n<li>Any C# preview feature is unsupported.<\/li>\n<li>There is no compatibility guarantee from one C# preview to another.<\/li>\n<\/ul>\n<p>In short, if you use C# 8.0 preview with Visual Studio 2019, some features and behaviors may change between now and when C# 8.0 fully releases.<\/p>\n<p>Happy hacking!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Starting with Visual Studio 2019 Preview 4, we&#8217;ll be adjusting how C# versions are treated in .NET tooling. Firstly, we&#8217;re adding two new Language Version (LangVersion) values: LatestMajor and Preview. Rad the post to see how they stack up with the currently supported list of values. <\/p>\n","protected":false},"author":678,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685,196,756],"tags":[9,30,46],"class_list":["post-21967","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","category-dotnet-core","category-csharp","tag-net-core","tag-announcement","tag-c"],"acf":[],"blog_post_summary":"<p>Starting with Visual Studio 2019 Preview 4, we&#8217;ll be adjusting how C# versions are treated in .NET tooling. Firstly, we&#8217;re adding two new Language Version (LangVersion) values: LatestMajor and Preview. Rad the post to see how they stack up with the currently supported list of values. <\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/21967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/678"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=21967"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/21967\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=21967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=21967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=21967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}