【问题标题】:Umbraco 7.1.9 on Windows Server 2012 (Azure)Windows Server 2012 (Azure) 上的 Umbraco 7.1.9
【发布时间】:2015-01-27 08:21:12
【问题描述】:

我们最近在 Azure 托管的 Windows Server 2012 VM 上部署了 Umbraco 7.1.9 应用程序。该应用程序在我们的开发人员机器上本地运行 #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'.

我们在服务器上安装了最新版本的 .NET Framework,每次更新都无法正常工作。

有人遇到过类似的问题吗?

【问题讨论】:

    标签: azure umbraco umbraco7 windows-server-2012-r2


    【解决方案1】:

    编辑:这里有用的线程...

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

    这没有帮助......

    我还没有看到这个问题,但我今天正在比较 Web.config 以从 7.1.4 升级到 7.1.9,我注意到两件事可能会对您有所帮助。

    1. 这是最近添加的:

      <add assembly="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      
    2. System.Web.Http 的 Web.config 中没有这样的东西:

      <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>
      

    让我想知道您的问题的答案是否可能是添加以下内容:

    <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>
    

    或者这个(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>
    

    【讨论】:

    • 谢谢,但似乎没有什么不同。事实上,System.Web.Http 没有定义,但它并没有解决我们的问题。我也尝试使用 5.2.2.0,但 Umbraco 使用的是 4.0.0.0 版本,所以当我指定 5.2.2.0 版本时,我得到了这个异常:Could not load file or assembly 'System.Web.Http, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
    • 无赖。在我们的内部 Windows Server 2012 R2 上升级很顺利。 /bin/System.Web.Http.dll 与 7.1.4 中的版本相同:4.0.20710.0。 /bin/umbraco.dll 现在是 1.0.5443.21812 与您的错误消息中的相同。也许&lt;bindingRedirect oldVersion="0.0.0.0-4.0.20710.0" newVersion="4.0.20710.0" /&gt;?我知道我现在正抓着稻草。如果我发现部署到 Azure 网站有任何问题(抱歉,不是 VM),我会通知您。
    • 发现了一个线程,其错误消息几乎与升级到 7.0.3 的人相同。那里列出了一些解决方法,例如清除 /bin 和恢复包。还有一个关于确保您拥有正确版本的 WebApi(可能不再是 4.0.30506)。 our.umbraco.org/forum/getting-started/installing-umbraco/…
    • 是的,我在发布这个问题之前看到了这篇文章。我尝试删除Microsoft.AspNet.WebApi 包并使用4.0.30506 版本手动安装它仍然是Umbraco 中使用的版本,但没有区别:( 我尝试在Windows Server 2008 机器上安装应用程序,同样的问题。
    • 好的,找到问题了!我们添加了依赖于AspNetWebApi.CoreLowercaseRoutesMVC4 包,这是一个未列出的包。它引用了System.Web.Http 的错误版本。我卸载了这个包,在我的路由配置中使用了LowercaseUrls 属性而不是 NuGet 包,现在一切都按预期工作了。感谢您的帮助和精神上的支持:)
    【解决方案2】:

    不确定它是否会对遇到此问题的其他人有所帮助,因为它对我们的项目非常具体。

    我们添加了依赖于 AspNetWebApi.CoreLowercaseRoutesMVC4 软件包,这是一个未列出的软件包。它引用了System.Web.Http 的错误版本。我卸载了这个包,在我的路由配置中使用了LowercaseUrls 属性而不是 NuGet 包,现在一切正常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-17
      • 2013-06-01
      • 2017-03-22
      • 2013-01-11
      • 1970-01-01
      • 2013-02-16
      相关资源
      最近更新 更多