Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 298
jeremyr Avatar asked Mar 23 '16 23:03

jeremyr


1 Answers

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.

like image 138
jeremyr Avatar answered Sep 30 '22 03:09

jeremyr