none
Using Expression Body on constructor RRS feed

  • Question

  • I do have a question about using an expression body inside of the constructor. I already set the target Framework to 4.7.2 and use C# 7.1 but still showing these squiggly lines. There's no error when building though.

    Speaking of setting the C# version to 7.1, when I push the code to the source control, one of my teammates always needs to convert the project from C# 7.0 to use the C# 7.1 even if before I push the code to the repository it uses the C# 7.1 version. 

    Reference image

    Regards


    • Edited by Dikong42 Tuesday, September 25, 2018 9:23 AM
    Tuesday, September 25, 2018 9:22 AM

All replies

  • If you hover over the red items what does it say? There are no visible issues in the shown code if using 4.7.2, this is valid in 4.6.x too.

    In regards to source control, what is begin used? My guess is how the project was originally created, what happens if you have your team mate create a similar class using the current framework and then you open the class from source code?


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Proposed as answer by Cherkaoui.Mouad Wednesday, September 26, 2018 6:45 AM
    Tuesday, September 25, 2018 10:23 AM
    Moderator
  • Hi Dikong42,

    If possible, could you please share a simple sample via OneDrive, which could reproduce the issue.

    Best regards,

    Zhanglong


    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.

    Wednesday, September 26, 2018 6:54 AM
    Moderator