Failed to add reference. User canceled out of save dialog (OLE_E_PROMPSAVECANCELLED)
Solution 1
Well, it turns out that this error message was actually completely useless in what the issue actually was.
The issue was caused by a version mismatch between the PCL and Windows Phone project. I finally realized that VS 2012 only lets you target Windows Phone 8.0 for phone apps, and not 8.1, and I was selecting Windows Phone 8.1 as one of the target frameworks in my PCL. In order to allow me to add a solution reference to the PCL, I had to add "Windows Phone Silverlight 8.0" as one of the target frameworks. Now it works fine.
I have no idea why that error message is the one that I was receiving, but hopefully this can help someone else out if they run into it.
Solution 2
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.
Solution 3
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.
Tell the person who locked the file to check in or undo the project file and then try to add the dependency
jeremyr
Updated on June 13, 2022Comments
-
jeremyr almost 2 years
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:
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.
-
Theodor Solbjørg almost 3 yearswas unable to undo, the file was just locked, if a unloaded the project and reloaded it again, then i was able to install nuget packages
-
gawkface almost 3 yearsAs mentioned in the other (Accepted) answer, the error message is indeed useless and saving project file (which was not happening so restarted visual studio) resolved for me the nuget package manager exception while installing a package
-
Diego Montania about 2 yearsI had the same problem to install a sqlite package para .net core 2.1 and running visual studio with adm control solved my problem, thanks.