New Error when Opening Projects

RogerSchlueter-7899 1,326 Reputation points
2025-01-10T17:34:33.53+00:00

As of today, when I open any solution that has this code snippet:

Windows.Application.  .....

I get this error:

'Application' is not a member of 'Windows'.

This did not occur when I shut down my PC last night and nothing has changed to my system over night. I am at a loss regarding how to proceed.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,343 questions
Visual Studio Setup
Visual Studio Setup
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
1,072 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 32,146 Reputation points Microsoft Vendor
    2025-01-13T06:43:00.8466667+00:00

    Hello @RogerSchlueter-7899,

    Could these solutions be built correctly before this issue appeared?

    Is this issue replicated in a newly created VB project? If so, could you kindly share us the complete steps?

    Currently, please try following(clean cache, repair VS and restore NuGet packages):

    1. Rename/Remove the hidden .vs folder in your solution folder, rebuild your solution/project.
    2. Repair VS from VS Installer => More => Repair(this takes some time).
    3. Open VS, click Tools => NuGet Package Manager => Package Manager Settings => check "Allow NuGet to download missing packages" and "Automatically check for missing packages during build in Visual Studio" options => click "Clear All NuGet Storage" => Right-click your solution => Restore NuGet Packages.
    4. In case the issue is caused by the namespace conflict, try to use the complete namespace, see if the error disappears(Windows.Application => System.Windows.Application).

    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.