visual studio c#

harm degenaar 0 Reputation points
2024-11-17T23:18:23.9033333+00:00

I get the following error message when opening a form in designer mode

|The file 'D:\Visual Studio Projects\VoV Biljart Woensdag V
2.1.0.7\VoV_Biljart\Form4.cs' does not support code parsing or generation
because it is not contained within a project that supports code.|The file 'D:\Visual Studio Projects\VoV Biljart Woensdag V
2.1.0.7\VoV_Biljart\Form4.cs' does not support code parsing or generation
because it is not contained within a project that supports code.| | -------- | -------- | |The file 'D:\Visual Studio Projects\VoV Biljart Woensdag V
2.1.0.7\VoV_Biljart\Form4.cs' does not support code parsing or generation
because it is not contained within a project that supports code. The file 'D:\Visual Studio Projects\VoV Biljart Woensdag V 2.1.0.7\VoV_Biljart\Form4.cs' does not support code parsing or generation because it is not contained within a project that supports code.|

what should I do ?

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

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 31,611 Reputation points Microsoft Vendor
    2024-11-18T03:22:52.2433333+00:00

    Hello @harm degenaar,

    I believe that the project supports code, kindly try following:

    1. Close VS, remove the hidden .vs folder in your solution folder, launch VS, open your project, rebuild it and check again. User's image User's image
    2. Repair VS from VS Installer > More > Repair(this takes some time).
    3. Try to create a new Form.cs file, copy and paste the code into this new file. Right-click your project > Add > Existing Item, select this new file and add it to your project, remove the "old" Form.cs file, see if this new Form.cs file works.

    If you have tried above three methods but the error persists, please try to create a new project and let us know if the same issue exists. If the issue doesn’t appear in the new project and your project is not complex, kindly consider copying and pasting the code into the new project and use this new project.

    Feel free to let us know the results.

    Sincerely,

    Tianyu


    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.