Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Razor在Azure';上使用包部署时的依赖性问题;s云服务_Razor_Azure_Azure Web Roles - Fatal编程技术网

Razor在Azure';上使用包部署时的依赖性问题;s云服务

Razor在Azure';上使用包部署时的依赖性问题;s云服务,razor,azure,azure-web-roles,Razor,Azure,Azure Web Roles,我正在尝试将RockPaperAzure项目部署到Azure云服务,但我遇到了此错误 Could not load file or assembly 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not

我正在尝试将RockPaperAzure项目部署到Azure云服务,但我遇到了此错误

Could not load file or assembly 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
我在搜索解决方案时发现的所有东西都只是建议在项目中包含.ddl文件并引用那些.dll文件,但这不起作用

我不知道少了什么


编辑:我通过将框架升级到ASP.NETMVC4解决了这个问题

您有引用旧verion-1.0的依赖程序集-使用NuGet更新所有引用。否则,可以将程序集绑定重定向添加到web.config:

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    ...
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime> 

...

请确保您引用的是部署在bin文件夹中的版本。

我尝试了这个方法,但通过将框架升级到ASP.NET MVC 4解决了这个问题。