VS2022 "Object reference not set to an instance of an object" with NuGet Package manager

Herb Auld 0 Reputation points
2023-09-18T22:06:14.8166667+00:00

In my VS2022 getting "Object reference not set to an instance of an object" when attempting to install via NuGet Package manager a component. Specifically, "Gembox.Spreadsheet". Attached file shows the NuGet output details.

I can install "CommunityToolkit.MVVM" without issue.

I tried on another machine by temporarily installing VS2022 and creating very small project and it works.

I have tried Upgrading, uninstalling/Installing no difference. My main development machine is Windows 10 with all current updates. I tried a very small project but that fails.

The vendor of the components cannot reproduce the issue.

Developer technologies | Visual Studio | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 31,056 Reputation points Microsoft External Staff
    2023-09-19T07:23:03.1366667+00:00

    Hi @Herb Auld

    Welcome to Microsoft Q&A! 

    Would you like to do a clean reinstallation for Visual Studio and install the package “Gembox.Spreadsheet” again? 

    1. Manually delete any leftover install and cache folder you previously installed to

    C:\Program Files (x86)\Microsoft Visual Studio

    %programdata%\Microsoft\visualstudio\packages

    C:\Program Files\Microsoft Visual Studio

    C:\Users\<UserName>\AppData\Local\Microsoft\VisualStudio 

    1. Delete the setup registry key, which was set when you first installed (Maybe there is only one key, please check one by one.):

    HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\VisualStudio\Setup

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\Setup

    HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\Setup 

    1. Download the new bootstrapper file from the page and reinstall the VS.

    The attached file is not available, if you still have the error, you can share us more details. 

    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.

    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.