none
Azure sdk 2.3 - Error compiling project with Azure.Storage in .net 4

    Question

  • My web project is targeting .NET 4 and uses WindowsAzure.Storage 3.0.3.0
    After I installed Azure SDK 2.3, I can't compile it. The error is :

    warning MSB3275: The primary reference "Microsoft.WindowsAzure.Storage, Version=3.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the assembly "Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" which was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".

    and then

    .....\AzureStorage.cs(4,30,4,37): error CS0234: The type or namespace name 'Storage' does not exist in the namespace 'Microsoft.WindowsAzure' (are you missing an assembly reference?)

    The exact same project compile correctly on another PC with SDK 1.2.
    And obviously it compile correctly in with .NET 4.5

    I think this is a bug.

    Someone has same problem ?

    for reference , these are nuget packages of the project:
    Successfully installed 'Microsoft.WindowsAzure.ConfigurationManager 2.0.3'.
    2> Successfully installed 'WindowsAzure.Storage 3.0.3.0'.
    2> Successfully installed 'System.Spatial 5.6.0'.
    2> Successfully installed 'Microsoft.Data.Services.Client 5.6.0'.
    2> Successfully installed 'Microsoft.Data.Edm 5.6.0'.
    2> Successfully installed 'Newtonsoft.Json 6.0.1'.
    2> Successfully installed 'Microsoft.Data.OData 5.6.0'.

    Tuesday, April 08, 2014 8:00 AM

Answers

All replies

  • Hi,

    According with the error message, I suggest you replace your Newtonsoft.Json dll file, the following version support .net 4.0, please try it, if this not resolved your issue, please give the recent error message to us.

    #http://json.codeplex.com/

    Hope this helps


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, April 09, 2014 1:42 AM
  • Thanks Jambor for your reply,

    I tried but still in error.

    I made some tests and I found that with newtonsoft.json up to version 5.0.8 the project compile correctly.

    Updating to a version 6 gives the error.

    I made a test project that can be downloaded here http://popup.blob.core.windows.net/test/AzureSDK2.3_Error.zip

    Finally I confirm that I have this error on 2 PC with VS2013 Update 2 RC and Azure SDK 2.3 installed, but there is no error on a PC with VS2013 Update 2 RC and Azure SDK 2.2 installed.In any case for now I downgraded to json.net 5.0.8

    Thanks

    Wednesday, April 09, 2014 12:39 PM
  • I'm having the same project. My .NET 4.0 project targets Newtonsoft.JSON 6.0.2 and has a reference to Microsoft.WindowsAzure.Storage 3.1.0.1. The error I'm getting is

    C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1696,5): warning MSB3275: The primary reference "Microsoft.WindowsAzure.Storage, Version=3.1.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the assembly "Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" which was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".

    error CS0234: The type or namespace name 'Storage' does not exist in the namespace 'Microsoft.WindowsAzure' (are you missing an assembly reference?)

    I used the reflection tool dotPeek to investigte. Turns out Microsoft.WindowsAzure.Storage.Dll 3.1.0.1 is a .NET 4 project with a .NET 4.5 reference to Newtonsoft.JSON. This is a bug and should be retargeted to the .NET 4 version of JSON.
    • Edited by LeonM Monday, April 14, 2014 10:59 PM
    Monday, April 14, 2014 10:57 PM
  • I had the same problem. I solved it by uninstalling Azure SDK 2.3.
    Tuesday, April 15, 2014 3:36 AM
  • I had the same problem. I solved it by uninstalling Azure SDK 2.3.

    How did you uninstall? It's not in my add/remove.
    Thursday, April 17, 2014 10:10 PM
  • for me uninstalling the azure SDK is not an option. I upgraded my .net 4 application to 4.5 and that solved it, but for many people that's not an option.
    Friday, April 18, 2014 6:30 AM
  • Hi all, Please try deleting or renaming newtonsoft.json.dll in program files\microsoft sdks\windows azure\.net sdk\v2.3\ref and the doing a full rebuild. We will be releasing an update to SDK 2.3 to fix this bug, but the above workaround should hopefully unblock you in the meantime. Thanks, Mohit [Microsoft Azure]
    Friday, April 18, 2014 7:13 AM
  • Thank you Mohit. Your suggestion worked for me.

    I moved the newtonsoft.json.dll to a _broken subfolder and this solved my VS 2013 build issue: "... reference could not be resolved because it has an indirect dependency on the assembly "Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" which was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".

    I am running VS 2013 Update 2 RC and Azure SDK 2.3. By moving this file, I did not have to uninstall Azure SDK 2.3.

    Friday, April 25, 2014 6:55 PM
  • I had a similar problem, the resolution didn't require deleting files, however; I went in and edited the project file and searched for multiple references to the offending library - found 2 and deleted out the old reference.

    After reloading the project everything compiled successfully.

    Thursday, May 08, 2014 5:18 AM