Reference assemblies error in Win 8 Release preview metro app

Answered Reference assemblies error in Win 8 Release preview metro app

  • Friday, July 13, 2012 9:23 AM
     
     

    I am developing a Win 8 metro app using the Bing Search API for Azure data market. I have included the BingSearchContainer.cs  from the Bing Azure website in my app.  This class requires the reference to system.Data.Services.Client, so I have included this in the project. The reference assembly is from "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.Services.Client.dll".

    The app compiles successfully, but when I run the app, I get the following error.

    "Could not load file or assembly 'System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. T
    he system cannot find the file specified."

    Any advise is greatly appreciated.



    • Edited by vbfnet Friday, July 13, 2012 9:24 AM
    • Edited by vbfnet Friday, July 13, 2012 9:24 AM
    •  

All Replies

  • Friday, July 13, 2012 10:25 PM
     
     

    Hi,

    You can look at following article on using OData for Metro Apps.

    http://blogs.msdn.com/b/astoriateam/archive/2012/04/26/metro-odata-prerelease-bits-and-app.aspx

    If the above article does not help then people at following forum definitely can help you.

    http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataservices/threads

    Thanks,

    Touseef

  • Saturday, July 14, 2012 8:35 AM
     
     

    Hi Touseef,

    Thanks for the links.

    The Bing Search API doesn't need to add a service reference in Visual Studio, I implemented this in Windows Phone 7 using the migration guide provided in the below link. They have provided a Proxy which can be downloaded.

    https://datamarket.azure.com/dataset/8818f55e-2fe5-4ce3-a617-0b8ba8419f65

    Also in the following example for Translator there is a Proxy provided and a Service reference is not required.

    http://code.msdn.microsoft.com/Walkthrough-Translator-in-7e0be0f7

     The project needs System.Data.Services.Client which is used by the proxy, so this needs to be added a Dependency reference.  While this worked for me Silverlight (WP7), its not working in Metro. The above examples are for .NET/C# console applications.

     

  • Sunday, July 15, 2012 2:56 AM
    Owner
     
     

    You are correct, we need to update our generated proxy classes to work with Windows 8 Metro and new OData classes.

    Let me check when we can do this and get back to you.

    Thanks,

    Max

  • Monday, July 16, 2012 3:02 AM
    Moderator
     
     
    You can also manually request the REST API and manually deserialize the result. You may want to use JSON format so that you can use Json.NET to help with the deserialization.

    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework

  • Monday, July 16, 2012 6:09 AM
    Owner
     
     

    In addition, here's a good reference:

    http://blogs.msdn.com/b/dau-blog/archive/2012/06/11/async-bing-for-metro-style-apps.aspx

    One update to the blog: you need to add Microsoft.Data.OData.Metro.dll to references as well (from same directory) in VS 11 July update.

    Thanks,

    Max


  • Monday, July 16, 2012 10:30 AM
     
     

    Thanks Max and Arwind.

    I will try it out and update this thread.

  • Monday, July 16, 2012 12:06 PM
     
     

    Hi Max,

    I can't find the Metro folder under \bin. The only folders available are .Net and Silverlight.  I have installed the WCF Data Services 5.0 for OData V3.  Is the Metro version publically available?

    C:\Program Files (x86)\Microsoft WCF Data Services\5.0\bin\Metro\Microsoft.Data.Services.Client.Metro.dll

    Thanks

       
  • Monday, July 16, 2012 4:27 PM
    Owner
     
     

    It should come by default with VS 11 July update for Release Preview.

    Do you install Ultimate?

    Thanks,

    Max

  • Monday, July 16, 2012 5:46 PM
     
     

    No, I am using VS 12 Express 2012 RC for Windows 8. I can't find the Metro folder under \bin.

    C:\Program Files (x86)\Microsoft WCF Data Services\5.0\bin

  • Monday, July 16, 2012 9:03 PM
    Owner
     
     Answered

    The library works only with VS Pro at this moment.

    Thanks,

    Max

  • Saturday, August 25, 2012 4:20 PM
     
     

    Hi,

    In the RTM Win 8 and Visual Studio 2012, the Metro folder in no longer under \bin. Is there an equivalent for Metro Apps (Windows store) - Microsoft.Data.OData.Metro.dll  ?

    C:\Program Files (x86)\Microsoft WCF Data Services\5.0\bin

  • Tuesday, September 04, 2012 1:08 AM
     
     

    Just ran into exactly the very same issue on my app.

    Added Microsoft.Data.Services.Client (different file name, contains the same namespace as the old one), Microsoft.Data.Services, Microsoft.Data.OData.

    Then, requested for System.Configuration as in:


    Cannot resolve Assembly or Windows Metadata file 'System.Configuration.dll'

    Xaml Internal Error error WMC9999: Type universe cannot resolve assembly: System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.


    So, I added then System.Configuration from C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5, v4.0 and v3.5. In all cases I get:


    C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v11.0\Microsoft.Windows.UI.Xaml.Common.targets(255,9): Xaml Internal Error error WMC9999: Cannot find type System.ServiceModel.Web.WebServiceHost in module System.ServiceModel.Web.dll.


    The only dll that contains the requested type (System.ServiceModel.Web.WebServiceHost) is C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.ServiceModel.Web.dll, but I cannot add a reference to it. VS11 says that it is automatically referenced by the build system.  But, I bet that it is referencing the version 4 or 5 of the same, none of which contains the required class.

    Ran into a wall :(



    • Edited by Andrés S Tuesday, September 04, 2012 1:35 AM
    • Edited by Andrés S Tuesday, September 04, 2012 1:38 AM
    • Edited by Andrés S Tuesday, September 04, 2012 1:38 AM readability
    • Edited by Andrés S Tuesday, September 04, 2012 1:38 AM improved readability
    •  
  • Tuesday, September 04, 2012 8:33 AM
     
     Proposed Answer
    • Proposed As Answer by Andrés S Tuesday, September 04, 2012 8:33 AM
    •