none
Manage Nuget Packages give Object Reference not set to an instance of an object RRS feed

  • Question

  • Dear ALL;

    I have a strange behavior of one of my solution in Visual Studio 2015 Enterprise.

    In that solution when i right click on any project and select Manage Nuget Packages gives me the following error dialog.

    I have started Visual Studio in safe mode and this issue is not appearing but i need a fix for that.


    Muhammad Makhaly [url]http://www.makhaly.net[/url]

    Friday, October 16, 2015 5:56 PM

Answers

  • Hi,

    I had the same problem. 

    I had an empty project.json file in one of my projects which prevented me from opening the NuGet Package Manager. I deleted the file and now I'm able to manage the Nuget Packages.

    Regards,

    Yannik

    Monday, November 2, 2015 4:19 PM
  • Dear Yannik;

    Thanks a lot for your help.

    I have found an empty project.json file in a Portable Class Library project, i have deleted it. Restart Visual Studio 2015 and it is working fine now.

    Many Many Many thanks.


    Muhammad Makhaly [url]http://www.makhaly.net[/url]


    Monday, November 2, 2015 9:49 PM

All replies

  • Hi Muhammad Makhaly,

    Please check the ActiveLog.xml under the path of %AppData%\Microsoft\VisualStudio\14.0. This file will log all operations when you operate Visual Studio.
    Open the ActiveLog.xml file and search "error" in this file to find out which package caused this problem. Then open Visual Studio to find the package in Tools -> NuGet Package Manager -> Packages Manager Console with command "Get-Package -Filter packagename -ListAvailable". You also can uninstall it directly with command "uninstall-package packagename".
    If it is not a NuGet package, please try searching it in Tools -> Extensions and Updates -> Installed tab. And then uninstall it in that window.

    If you can't find which package in the log file, I'm afraid that you need to remove the packages installed one by one to troubleshoot which one caused this problem.

    In addition, you can try repair Visual Studio with Control Panel -> Visual Studio 2015 -> Change -> Repair to check whether it will be fix this bug.

    Best Regards,
    Weiwei

    Tuesday, October 20, 2015 6:09 AM
    Moderator
  • Dear Weiwei;

    I have viewed the ActivityLog.xml and found the following warning "Package failed to load; error message suppressed by skip flag"

    And the following Error "Construction of frame content failed. Frame identifier: ST:0:0:{f52ab1d2-f7f8-4cef-b359-92ca6c171072} Frame caption: Cloud Explorer Exception details: System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) at Microsoft.VisualStudio.Shell.Interop.IVsShell5.LoadPackageWithContext(Guid& packageGuid, Int32 reason, Guid& context) at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.GetPackage() at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()"

    But i think it is another issue. By the way i am repairing Visual Studio now and see what will happens.

    Friday, October 30, 2015 7:59 PM
  • Dear Weiwei;

    I have repaired the Visual Studio 2015, but still the issue appears.

    When i see the ActivityLog.xml after repairing. I have found one package call IntegrationPackage can't be loaded.

    When i used the Package Manager Console, it gives me the following Error.

    Also i could not see any default project in the Default Project List.


    Muhammad Makhaly [url]http://www.makhaly.net[/url]

    Saturday, October 31, 2015 7:17 AM
  • Dear Weiwei;

    I have opened the same solution in Visual Studio 2013 Update 5 and i can manage the nugets. so it is a bug in the Visual Studio 2015.


    Muhammad Makhaly [url]http://www.makhaly.net[/url]


    Sunday, November 1, 2015 5:12 PM
  • Hi Muhammad Makhaly,

    Is this problem occurred when you installed Visual Studio 2015? Does it work fine before? If it works fine before, do you have do any changes before this problem?

    Please try uninstall NuGet Packages Manager for Visual Studio 2015 and re-install it with following steps. There may be something wrong when install the NuGet Packages Manager.

    1. Open Visual Studio 2015.
    2. Click "Tools" menu and choose "Extensions and Updates".
    3. Search "NuGet" in Installed tab. It will list in the result window.
    4. Choose "NuGet Packages Manager for Visual Studio 2015" and uninstall it.
    5. Searching NuGet again in the Extensions and Updates window and install it again.

    Best Regards,
    Weiwei

    Monday, November 2, 2015 4:40 AM
    Moderator
  • Hi,

    I had the same problem. 

    I had an empty project.json file in one of my projects which prevented me from opening the NuGet Package Manager. I deleted the file and now I'm able to manage the Nuget Packages.

    Regards,

    Yannik

    Monday, November 2, 2015 4:19 PM
  • Dear Yannik;

    Thanks a lot for your help.

    I have found an empty project.json file in a Portable Class Library project, i have deleted it. Restart Visual Studio 2015 and it is working fine now.

    Many Many Many thanks.


    Muhammad Makhaly [url]http://www.makhaly.net[/url]


    Monday, November 2, 2015 9:49 PM