none
What's new in C# X.X? RRS feed

Answers

  • For the most part you don't have to do anything as the Roslyn analyzers are already available in VS 2017. For some of the newer features you'll have to opt in to getting the suggestion. This is done by setting up an editorconfig file and set the feature as a suggestion. The IDE will then provide suggestions. This approach allows you to opt into some features (or even report them as warnings/errors) while ignoring others.

    Next up you can consider installing additional analyzers in VS or your solution to help get more feedback. At the VS level you can take a look at the Microsoft Code Analysis 2017 extension. You can browse for this extension via Extensions & Updates option in VS.

    If you want more advanced capabilities then third party tools like ReSharper or CodeRush are a good option. They do cost money but can be worth the investment. I'm a CodeRush person myself and use it all the time. But if you don't want to spend money then stick with the free stuff for now.


    Michael Taylor http://www.michaeltaylorp3.net

    Saturday, June 9, 2018 3:44 PM
    Moderator

All replies

  • The new spelling is strictly optional -- it is "syntax sugar".  If it doesn't make sense to you, then use the version that does make sense.  The compiled code will be identical.

    I assume you already realize that the other syntax has been around for a very long time:

        int? i4 = null;

    It's the inline use ("customers?[0]") that is new in C# 6.


    Tim Roberts, Driver MVP Providenza & Boekelheide, Inc.

    Wednesday, June 6, 2018 6:03 PM
  • Hi Markus Freitag,

    Thank you for posting here.

    >>What's new in C# X.X?

    It is the version of C#. Different version of C# has different new features.

    You could use these new features with the special C# version. Here is the steps to change the C# version.

    Right click your project> Choose Properties> Build> Click Advanced> Choose the language version in Advanced Build version.

    >>Are there other common spellings?

    If the common spellings is the new feature, please check the overview of new features from MSDN document for your reference.

    https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/ 

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, June 7, 2018 3:31 AM
    Moderator
  • Hi,

    i'm looking for a TABLE

    OLD                                          NEW or alternative

    ---------------------------

    Property get; set;                         Property  => varX

    -----------------------------------

    In this case I think it is easier to lean the new spelling

    Regards Markus     


    Thursday, June 7, 2018 5:02 PM
  • There really isn't a table because not all features have a direct mapping. However the refactoring tools in VS are updated with this so as you type in your code you may get quick action recommendations. In this case it will take your existing code and offer to rewrite it. You can review the proposed change to ensure it meets your needs and then apply it. You don't have to do the conversion yourself.

    Michael Taylor http://www.michaeltaylorp3.net

    Thursday, June 7, 2018 6:23 PM
    Moderator
  •  
    Hi CoolDadTx,
     >You don't have to do the conversion yourself.
    How do you do that then?With CSharper or other Tools?

     Resharper is not free.
     Do you have a recommendation? How is the best way?
     
     With best regards Markus

    Saturday, June 9, 2018 10:09 AM
  • For the most part you don't have to do anything as the Roslyn analyzers are already available in VS 2017. For some of the newer features you'll have to opt in to getting the suggestion. This is done by setting up an editorconfig file and set the feature as a suggestion. The IDE will then provide suggestions. This approach allows you to opt into some features (or even report them as warnings/errors) while ignoring others.

    Next up you can consider installing additional analyzers in VS or your solution to help get more feedback. At the VS level you can take a look at the Microsoft Code Analysis 2017 extension. You can browse for this extension via Extensions & Updates option in VS.

    If you want more advanced capabilities then third party tools like ReSharper or CodeRush are a good option. They do cost money but can be worth the investment. I'm a CodeRush person myself and use it all the time. But if you don't want to spend money then stick with the free stuff for now.


    Michael Taylor http://www.michaeltaylorp3.net

    Saturday, June 9, 2018 3:44 PM
    Moderator