Failed to add reference. User canceled out of save dialog (OLE_E_PROMPSAVECANCELLED)

Viewed 12751

I cannot add a solution reference to a portable class library to my Windows Phone 8.0 apps in Visual Studio 2012. When I try to add it by browsing to the .DLL, then it works. I receive this error when I try:

Failed to add reference

I am able to add a reference to the portable class library in my web service project, so the library itself appears to be OK.

I have tried:

  • Restarting Visual Studio.
  • Restarting Windows
  • Creating a new Windows Phone project
  • Creating a new portable class library
  • Repairing the Windows Phone 8 SDK
  • Repairing Visual Studio 2012

Regardless of what combination of those things I have tried, attempting to add a solution reference to a portable class library in a Windows Phone project gives me that error.

5 Answers

Problem in my case

I am not able to install Microsoft.EntityFrameworkCore.Tools package. Every time I run the command inside Package Console it shows an error like this

Error

User canceled out of save dialog (Exception from HRESULT: 0x8004000C)

Solution

Restart Visual studio 2019 in admin mode. 

Please make sure your project file is not locked. You can check it by trying to edit the project file (.csproj file). If this file is locked, you cannot add the dependencies.

Edit project file context menu location

Tell the person who locked the file to check in or undo the project file and then try to add the dependency

Make sure you have saved any files that you have been working on before attempting this operation. I went to restart Visual Studio and it informed me that I had some pending saves. I saved, restarted and then was able to add the project reference.

Close the Visual Studio and open in run as Administrator .Then try to install the packages.I hope this will work.

Related