Object reference not set to an instance of an object.

Joshua Harper 0 Reputation points
2024-06-20T18:37:34.2866667+00:00

Upon upgrading from Visual Studio 2019 to Visual Studio 2022 I am now unable to build our website. I am successfully able to compile our WebService but when trying to compile out Web Site I get the following error without context. The output window states "Build (web): Object reference not set to an instance of an object." and the error list states "Object reference not set to an instance of an object." with no tied project, file, or line. After an extensive amount of effort to find a solution, I have come up short. Any advice would be useful.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,821 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 27,636 Reputation points Microsoft Vendor
    2024-06-21T03:47:20.9+00:00

    Hi @Joshua Harper

    Welcome to Microsoft Q&A! 

    Please close all running VS instances and try to delete the hidden .vs, bin and obj folders in the project folder.

    Then, rebuild the solution. 

    If it doesn’t work, please ensure that you install the same components or workloads in VS2022 as in VS2019.

    Besides, please check its target framework and assembly references. 

    Sincerely,

    Anna


    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.