Solution gives error "the type or namespace 'System' can't be found...

Chris Ball 0 Reputation points
2024-07-27T00:02:42.33+00:00

I finally got it to stop throwing errors. Deleted all OBJ and BIN directories in solution repository, re-built project now I don't have 171 errors.

This is really annoying, why can't VS be written to automatically either fix the problem or give the user more useful information to solve the problem?

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

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 31,246 Reputation points Microsoft Vendor
    2024-07-29T07:22:30.78+00:00

    Hello @Chris Ball,

    If you get many errors, for example in your scenario, 171 errors, probably it’s caused by some cache or wrongly configuration.

    In this case, VS may fail to show the correct cause, but show you every specific errors. You can sometimes confirm this by creating a new project, and checking if the same error appears on that newly created project.

    This issue usually appears after you create a new project, open an old project, or do some modifications on the existing project.

    Rebuilding project is usually one of the important steps for eliminating these errors. Though rebuilding the project cleans the project first, not all the cache files or folders will be removed. If rebuilding doesn’t work, manually removing these cache(BIN, OBJ, the hidden .vs folder) is needed.

    Anyway, it seems you had fixed this issue, glad to know that it doesn’t block you anymore:)

    Feel free to contact us if you get any other issues in the future.

    Have a great day!

    Best Regards,

    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.

    0 comments No comments

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.