Musings of a PC

Thoughts about Windows, TV and technology in general

VS2012, Windows Phone and the “Reference to a higher version” error

Having installed Windows 8 Pro, Visual Studio 2012 Premium and the new Windows Phone 8 SDK, I was keen to make sure that my Windows Phone 7.1 project still built & worked. That meant getting all of the references to work again.

Most of the references were for packages that I could install through Nuget. However, one was for a Zip file that I had to download and unpack. Upon browsing to the appropriate DLL and selecting it as the reference, Visual Studio promptly reported:

A reference to a higher version or incompatible assembly cannot be added to the project

The ultimate solution was to right-click on each of the files that had been contained in the Zip file, choosing Properties and then clicking on the Unblock button. Once that was all done, Visual Studio then allowed me to add the reference, although it did warn me that it might be unstable! Not a lot I can do about that J.

About these ads

20 responses to “VS2012, Windows Phone and the “Reference to a higher version” error

  1. Sahan Serasinghen December 11, 2012 at 9:31 am

    Thanks a lot mate. I had exactly the same problem when importing Flurry Analytics DLL for WP7 You just saved my day :)

  2. Adrian January 5, 2013 at 5:51 pm

    Thanks!!! I had been searching a solution for hours!!

  3. Shubhan Chemburkar February 21, 2013 at 3:17 pm

    Reblogged this on World Wide Code and commented:
    Thanks. I had the same problem for Microsoft.Practices.Prism.Interactivity.dll

  4. Bob February 26, 2013 at 4:07 pm

    Where do you see the “Unblock” option?

  5. Lekshmi March 13, 2013 at 5:12 am

    I can’t see the unblock button and the same means its already unblock to use,right! but i’m not able to add the class library reference to my Windows Phone 8 application and the same error ‘A reference to a higher version or incompatible assembly cannot be added to the project’ appears. Please help me out!

    • Philip Colmer March 13, 2013 at 8:22 am

      Are there any other files associated with the library? You need to make sure that you have unblocked absolutely every file, and it has to be done one by one as you cannot unblock multiple files.

  6. liz March 13, 2013 at 5:37 am

    Where do you see the “Unblock” option?

    • Philip Colmer March 13, 2013 at 8:23 am

      When you right-click on the file and choose Properties, it is displayed at the bottom of the window. If you aren’t seeing the button, the file is already unblocked for use.

      • itslekshmi March 13, 2013 at 8:37 am

        My Class library contain only 3 class files and I can see not any unblock button for the classes. After googling a lot, now I added a PortableClassLibrary but I’m not getting my required namespaces- System.Data,System.Web.Services etc. Please help me out.

      • Philip Colmer March 13, 2013 at 8:58 am

        I’m sorry but I’m not sure what to suggest. It is possible that there are other reasons for the error being displayed, so all I can suggest is you post to an MSDN forum or to StackOverflow to see if anyone has other suggestions.

        Sorry that my information hasn’t helped in your situation.

    • itslekshmi March 13, 2013 at 9:00 am

      Thank you for your valuable suggestion and help.

  7. Nikolay July March 14, 2013 at 12:49 pm

    Really thanks!

  8. Elgranj April 8, 2013 at 2:59 am

    Thanks!

    You saved me a great headache :-)

    Cheers.

  9. Ryan April 24, 2013 at 12:29 am

    Awesome, thanks!

  10. Eric Fleming July 22, 2013 at 3:40 am

    Thank you so much man! Wasted about 25 minutes before I found this article.

  11. Andrew Coates September 16, 2013 at 4:24 am

    Bingo! I had the same problem with the Nokia Here Launchers. Would have been futzing around for ages if you hadn’t posted this,

  12. epeli toni November 6, 2013 at 4:54 pm

    Didn’t get JSON Net45 working with this trick but the portable started running in VS. Thanks! :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: