CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: How do I upgrade to C# 8?

  1. #1
    Join Date
    Mar 2020
    Posts
    2

    How do I upgrade to C# 8?

    I figured you just download the latest VS and that's it, you've got the latest version of C#, but today I got an error when trying to set a property to readonly, saying "Feature 'readonly members' is not availble in C# 7.3. Please use language version 8.0 or greater."

    So it seems I'm using version 7.3, how do I upgrade?
    Thanks

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,401

    Re: How do I upgrade to C# 8?

    What version of Visual Studio are you using?

  3. #3
    Join Date
    Mar 2020
    Posts
    2

    Re: How do I upgrade to C# 8?

    Quote Originally Posted by Zubon View Post
    I figured you just download the latest VS and that's it, you've got the latest version of C#, but today I got an error when trying to set a property to readonly, saying "Feature 'readonly members' is not availble in C# 7.3. Please use language version 8.0 or greater."

    So it seems I'm using version 7.3, how do I upgrade?
    Thanks
    I see, so VS uses .NET Core 2 by default and I need to upgrade to .NET Core 3.

    I have VS version 16.4.5, .NET Core 3 should be installed with this version. I don't get any option to choose which version of .NET Core to use when starting a new project though. How do I change to .NET Core 3? If I started a project with .NET Core 2 can that project be updated to use .NET core 3? Thanks for your useful advices.

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,401

    Re: How do I upgrade to C# 8?

    Download the .net core 3.1 sdk and install it.

  5. #5
    Join Date
    Sep 2020
    Posts
    13

    Re: How do I upgrade to C# 8?

    o target different/latest c# version (. NET Core 3 and C# 8)
    Open the project properties window (right click on project, select properties)
    Select 'Build' from the left hand side options.
    Scroll down to the Advanced options.
    Select the desired version of c#, click ok.

    Hope this information is helpful to you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)