Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

737
Views
Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater - Error on one machine but works on another

When using Visual Studio Enterprise 16.3.7 on two separate machines one builds fine and the other machine throws the error:

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

enter image description here

enter image description here

This can easily be solved on the none working machine by setting LangVersion in .csproj as suggested here https://stackoverflow.com/a/48085575/3850405 or let Visual Studio automatically fix it like the print screen above.

<LangVersion>8.0</LangVersion>

What I can't understand is why one machine builds fine without this line in .csproj and the other machine needs it?

over 4 years ago · Santiago Trujillo
8 answers
Answer question

0

I downloaded the latest version of .Net Core 3.0 and 3.1 and had the same issue. For me, the fix seemed to download the latest update for Visual Studio 2019 (to version 16.4.2).

This also restarted my computer and the error went away.

over 4 years ago · Santiago Trujillo Report

0

I received the same error, but I had simply forgotten to include the

<LangVersion>8.0</LangVersion>

attribute in ALL the .csproj files in the solution. The following is my current c# 8 setup:

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <LangVersion>8.0</LangVersion>
    <Nullable>enable</Nullable>
    <NullableContextOptions>enable</NullableContextOptions>
  </PropertyGroup>

I found the following documents to be the most helpful when migrating from core 2.2 to 3.x:

MSDN 2.2 -> 3.0

MSDN 3.0 -> 3.1

over 4 years ago · Santiago Trujillo Report

0

I had to update Visual Studio to version from 16.3.X to 16.4.2. This resolved the problem and I didn't have to add any LangVersion.

Credits: https://github.com/aspnet/AspNetCore.Docs/issues/16047

over 4 years ago · Santiago Trujillo Report

0

I did the following and it solved my issue:

  1. create a file named "Directory.Build.props" in the solution directory and writing this code:

    <Project>
     <PropertyGroup>
      <LangVersion>latest</LangVersion>
     </PropertyGroup>
    </Project>
    
  2. Deleted the .vs folder (it is hidden in the solution directory)

  3. Restart the Visual Studio

over 4 years ago · Santiago Trujillo Report

0

2021

Cause: You may be targeting .NET Standard 2.0, which uses C# 7.3.

Fix: Under the project's Properties, click on the Application panel and choose .NET Standard 2.1 as the Target framework.

After the above change, Visual Studio 2019 will fix the issue by itself, and no LangVersion setting will be necessary.

See: C# language versioning

enter image description here

over 4 years ago · Santiago Trujillo Report

0

You must forget this tag in one of your PropertyGroup 's in your *.csproj file

<LangVersion>8.0</LangVersion>

over 4 years ago · Santiago Trujillo Report

0

If you install resharper, it will automatically modify the csproj files for you ;)

over 4 years ago · Santiago Trujillo Report

0

Check that you have valid configuration on both machines (Debug/Release, x64/Any CPU). This could also result to this error.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!