Compilation error :" is not available in C# 7.3. Please use language version 8.0 or greater

raymond0517

New member
Joined
Dec 23, 2020
Messages
4
Programming Experience
Beginner
Hi, Forum,

I have this class library which I want to issue a ShowWindow command to make the window visible or hidden, it takes in the variable "handle" as window handle.

In the attached 2 screenshots, it shows the coding, namespaces, references and error messages.

The error is at line 17 and 18.

Need help to correct the declaration of ShowWindow

Thanks.
 

Attachments

  • Screenshot (117).png
    Screenshot (117).png
    111.1 KB · Views: 367
  • Screenshot (118).png
    Screenshot (118).png
    98.7 KB · Views: 357
Please don't post code as screenshots alone. Post code as text and format it as code. If adding a screenshot provides value then add that too but that is in addition to the text, not instead of. The same goes for error messages. They are text so provide them as text. If we want to copy and paste your code or error messages to test or search then we can't do it from pictures.

As for the issue, what are you actually trying to achieve there. You are declaring an unmanaged function inside another function. Is that specifically intentional? C# does support local functions, static local functions and even external local functions but, as the error messages are telling you, not in the version of C# you're using. I suspect that, just as in your previous thread, you are trying to run before you can walk and trying to do things well in advance of what you actually understand. If you have no concept of why those error messages have been generated then you have bitten off more than you can chew and you need to do far more research on the basics first. If you do understand and just need to know what to do about language versioning, you can find out more here:

C# language versioning - C# Guide | Microsoft Docs
 
Back
Top Bottom