How to fix Invalid value ''' for RazorLangVersion. Valid values include 'Latest' or a valid version in range 1.0 to 8.0.

Rohan Patil 0 Reputation points
2024-04-10T07:37:04.29+00:00

Im getting below CSC error while building a solution. I recently installed a new VS latest 2022 version. Same solution was working previously as expected.
Error message - Severity Code Description Project File Line Suppression State

Error RZ3600 Invalid value ''' for RazorLangVersion. Valid values include 'Latest' or a valid version in range 1.0 to 8.0.User's image

Has anyone faced this issue? Please help me if possible on this. Thanks !

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,626 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 25,801 Reputation points Microsoft Vendor
    2024-04-11T06:08:03.84+00:00

    Hi @Rohan Patil, 

    Welcome to Microsoft Q&A! 

    Please check the <RazorLangVersion> property in the project file:

      <RazorLangVersion>{VERSION}</RazorLangVersion>

    For more information, you can see: Razor language version

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".  Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.