【问题标题】:Azure Umbraco Web Matrix Publish ErrorAzure Umbraco Web 矩阵发布错误
【发布时间】:2016-11-04 12:50:29
【问题描述】:

我在通过 webmatrix 将 Umbraco 安装到 Azure 时遇到问题。

这是错误:

> Could not load file or assembly 'System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

> WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

我在网上找不到任何东西来帮助解决这个问题。这是一个非常基本的 Umbraco 安装,只有一个插件:嵌套内容。

这是完整的堆栈跟踪:

> [FileLoadException: Could not load file or assembly
> 'System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral,
> PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The
> located assembly's manifest definition does not match the assembly
> reference. (Exception from HRESULT: 0x80131040)]   
> System.RuntimeTypeHandle.GetTypeByName(String name, Boolean
> throwOnError, Boolean ignoreCase, Boolean reflectionOnly,
> StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean
> loadTypeFromPartialName, ObjectHandleOnStack type) +0   
> System.RuntimeTypeHandle.GetTypeByName(String name, Boolean
> throwOnError, Boolean ignoreCase, Boolean reflectionOnly,
> StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean
> loadTypeFromPartialName) +70    System.RuntimeType.GetType(String
> typeName, Boolean throwOnError, Boolean ignoreCase, Boolean
> reflectionOnly, StackCrawlMark& stackMark) +40   
> System.Type.GetType(String typeName) +30   
> System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow)
> +108    System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +88   
> Umbraco.Core.Persistence.Database.CommonConstruct() +35   
> Umbraco.Core.Persistence.Database..ctor(String connectionString,
> String providerName) +119   
> Umbraco.Core.DatabaseContext.ValidateDatabaseSchema() +211   
> Umbraco.Core.ApplicationContext.get_IsUpgrading() +68   
> Umbraco.Web.Security.Identity.AppBuilderExtensions.UseUmbracoBackOfficeCookieAuthentication(IAppBuilder
> app, CookieAuthenticationOptions options, ApplicationContext
> appContext, PipelineStage stage) +96   
> Umbraco.Web.Security.Identity.AppBuilderExtensions.UseUmbracoBackOfficeCookieAuthentication(IAppBuilder
> app, ApplicationContext appContext, PipelineStage stage) +314   
> Umbraco.Web.UmbracoDefaultOwinStartup.ConfigureMiddleware(IAppBuilder
> app) +30   
> Umbraco.Web.UmbracoDefaultOwinStartup.Configuration(IAppBuilder app)
> +44
> 
> [TargetInvocationException: Exception has been thrown by the target of
> an invocation.]    System.RuntimeMethodHandle.InvokeMethod(Object
> target, Object[] arguments, Signature sig, Boolean constructor) +0   
> System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj,
> Object[] parameters, Object[] arguments) +160   
> System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
> invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
> +101    Owin.Loader.<>c__DisplayClass12.<MakeDelegate>b__b(IAppBuilder builder) +66   
> Owin.Loader.<>c__DisplayClass1.<LoadImplementation>b__0(IAppBuilder
> builder) +123   
> Microsoft.Owin.Host.SystemWeb.<>c__DisplayClass2.<InitializeBlueprint>b__0(IAppBuilder
> builder) +71   
> Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action`1
> startup) +462   
> Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action`1 startup) +40 
> Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +70
> System.Threading.LazyInitializer.EnsureInitializedCore(T& target,
> Boolean& initialized, Object& syncLock, Func`1 valueFactory) +115   
> Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication
> context) +106   
> System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr
> appContext, HttpContext context, MethodInfo[] handlers) +536   
> System.Web.HttpApplication.InitSpecial(HttpApplicationState state,
> MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172   
> System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr
> appContext, HttpContext context) +336   
> System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr
> appContext) +296
> 
> [HttpException (0x80004005): Exception has been thrown by the target
> of an invocation.]   
> System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9963380 
> System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)
> +101    System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest
> wr, HttpContext context) +254

【问题讨论】:

    标签: asp.net .net azure umbraco webmatrix


    【解决方案1】:

    错误信息表明 System.Data.SqlServerCe.dll 未正确加载。根据我的经验,可能是 System.Data.SqlServerCe.dll 文件不在 bin 文件夹中,或者在 web.config 文件中未正确配置。我们可以在本地查看项目中的文件,使用kudu工具查看Azure门户中的文件。更多细节请参考截图。我也找到了一些关于How to installing Umbraco with Microsoft WebMatrix的资料。

    如果 Web.config 中没有此设置,请在 Web.config 文件中添加。

    <system.data>
        <DbProviderFactories>
            <add invariant="System.Data.SqlServerCe.4.0" name="Microsoft® SQL Server® Compact 4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
        </DbProviderFactories>
    </system.data>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多