简体   繁体   English

Windows Server 2012(Azure)上的Umbraco 7.1.9

[英]Umbraco 7.1.9 on Windows Server 2012 (Azure)

We recently deployed a Umbraco 7.1.9 application on a Windows Server 2012 VM hosted by Azure. 我们最近在Azure托管的Windows Server 2012 VM上部署了Umbraco 7.1.9应用程序。 The application works #1 locally on our developer machines but when we deploy the website on the VM we get this error: 该应用程序在我们的开发人员计算机上本地工作#1,但是当我们在VM上部署网站时,出现此错误:

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Reflection.ReflectionTypeLoadException: Could not load types from assembly umbraco, Version=1.0.5443.21812, Culture=neutral, PublicKeyToken=null, errors:
Exception: System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method.  Type: 'Umbraco.Web.Editors.ContentPostValidateAttribute'.  Assembly: 'umbraco, Version=1.0.5443.21812, Culture=neutral, PublicKeyToken=null'.
Exception: System.TypeLoadException: Could not load type 'System.Web.Http.Controllers.IControllerConfiguration' from assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Exception: System.TypeLoadException: Could not load type 'System.Web.Http.Controllers.IControllerConfiguration' from assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Exception: System.TypeLoadException: Could not load type 'System.Web.Http.Controllers.IControllerConfiguration' from assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Exception: System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method.  Type: 'Umbraco.Web.WebApi.Filters.EnsureUserPermissionForContentAttribute'.  Assembly: 'umbraco, Version=1.0.5443.21812, Culture=neutral, PublicKeyToken=null'.
Exception: System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method.  Type: 'Umbraco.Web.WebApi.Filters.EnsureUserPermissionForMediaAttribute'.  Assembly: 'umbraco, Version=1.0.5443.21812, Culture=neutral, PublicKeyToken=null'.
Exception: System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method.  Type: 'Umbraco.Web.WebApi.Filters.FileUploadCleanupFilterAttribute'.  Assembly: 'umbraco, Version=1.0.5443.21812, Culture=neutral, PublicKeyToken=null'.
Exception: System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method.  Type: 'Umbraco.Web.WebApi.Filters.FilterAllowedOutgoingMediaAttribute'.  Assembly: 'umbraco, Version=1.0.5443.21812, Culture=neutral, PublicKeyToken=null'.
Exception: System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method.  Type: 'Umbraco.Web.WebApi.Filters.FilterAllowedOutgoingMediaAttribute'.  Assembly: 'umbraco, Version=1.0.5443.21812, Culture=neutral, PublicKeyToken=null'.
Exception: System.TypeLoadException: Could not load type 'System.Web.Http.Controllers.IControllerConfiguration' from assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Exception: System.TypeLoadException: Could not load type 'System.Web.Http.Dispatcher.DefaultHttpControllerSelector' from assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

We installed the latest version of .NET Framework, every updates on the server and we can't get it to work. 我们安装了最新版本的.NET Framework,并在服务器上进行了每次更新,但我们无法使其正常工作。

Anyone got a similar issue? 任何人都有类似的问题吗?

EDIT : Useful thread here... 编辑 :有用的线程在这里...

http://our.umbraco.org/forum/getting-started/installing-umbraco/48351-Umbraco-703-is-totally-broken-after-fresh-nuget-install http://our.umbraco.org/forum/getting-started/installing-umbraco/48351-Umbraco-703-is-totally-broken-after-fresh-nuget-install

This didn't help... 这没有帮助...

I haven't seen that problem yet but I'm diffing Web.config to upgrade from 7.1.4 to 7.1.9 today and I've noticed two things that might help you. 我还没有看到这个问题,但今天我正在将Web.config从7.1.4升级到7.1.9,我注意到有两件事可能会对您有所帮助。

  1. This was added recently: 这是最近添加的:

     <add assembly="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
  2. There is nothing like this in Web.config for System.Web.Http: Web.config中没有针对System.Web.Http的内容:

     <dependentAssembly> <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/> </dependentAssembly> 

Makes me wonder if the answer to your problem might be adding this: 让我想知道您问题的答案是否可能要添加以下内容:

<dependentAssembly>
    <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>

Or this ( seen here ): 或者这个( 在这里看到 ):

<dependentAssembly>
    <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" />
</dependentAssembly>

Not sure it will be helpful for anyone else having this issue as it is very specific to our project. 不确定是否对其他遇到此问题的人有所帮助,因为它对我们的项目非常特定。

We added the LowercaseRoutesMVC4 package that depends on AspNetWebApi.Core which is an unlisted package. 我们添加了LowercaseRoutesMVC4包取决于AspNetWebApi.Core这是不公开的包。 It references a bad version of System.Web.Http . 它引用了System.Web.Http的错误版本。 I uninstalled this package, used the LowercaseUrls property in my route configuration instead of the NuGet package and now everything works as expected. 我卸载了此程序包,在路由配置中使用了LowercaseUrls属性,而不是NuGet程序包,现在一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM