我在通过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
答案 0 :(得分:0)
错误消息表明未正确加载System.Data.SqlServerCe.dll。根据我的经验,它可能是不在bin文件夹中的System.Data.SqlServerCe.dll文件,或者在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>