WindowsAzure.MobileService破坏ASP.NET MVC应用程序

WindowsAzure.MobileService破坏ASP.NET MVC应用程序,asp.net,asp.net-mvc,azure-mobile-services,Asp.net,Asp.net Mvc,Azure Mobile Services,我是新的azure移动服务和ASP.NET MVC,已经成功创建并发布了移动服务。它很好用 我的问题是如何在ASP.NET MVC应用程序中使用它 我从头创建了一个ASP.NET MVC应用程序,添加了以下nuget WindowsAzure.MobileService 快乐的日子没有问题 我的控制器里有 public static MobileServiceClient MobileService = new MobileServiceClient("http://localhost:5027

我是新的azure移动服务和ASP.NET MVC,已经成功创建并发布了移动服务。它很好用

我的问题是如何在ASP.NET MVC应用程序中使用它

我从头创建了一个ASP.NET MVC应用程序,添加了以下nuget WindowsAzure.MobileService

快乐的日子没有问题

我的控制器里有

public static MobileServiceClient MobileService = new MobileServiceClient("http://localhost:50270/");

var list = await MobileService.InvokeApiAsync<IEnumerable<xxxx>>("xxxxxx",System.Net.Http.HttpMethod.Get, null);
公共静态MobileServiceClient MobileService=新的MobileServiceClient(“http://localhost:50270/");
var list=await mobileseservice.InvokeApiAsync(“xxxxxx”,System.Net.Http.HttpMethod.Get,null);
当我运行该网站时,它会出现以下错误。出于某种原因,它不喜欢@Html(Razor语法)

编译器错误消息:CS0012:在未引用的程序集中定义了类型“System.Object”。必须添加对程序集“System.Runtime,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”的引用。
源错误:
第18行:
第19行:
第20行:-->Error@Html.ActionLink(“应用程序名”、“索引”、“主页”、新的{area=”“}、新的{@class=“navbar品牌”})
第21行:
第22行:
如果我去掉“WindowsAzure.MobileService”软件包,它就可以正常工作

我做错了什么?我错过什么了吗


这也是在ASP.NET中使用移动服务的正确方式吗?

这是在MVC应用程序中使用可移植类库的问题。您可以将System.Runtime程序集添加到web.config(或视图文件夹的web.config)以解决此问题

<compilation debug="true" targetFramework="4.5">
    <assemblies>
        <add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </assemblies>
</compilation>

<compilation debug="true" targetFramework="4.5">
    <assemblies>
        <add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </assemblies>
</compilation>