Мы пытаемся развернуть наше решение MVC для клиента, но при попытке входа в систему они получают ошибку.Поставщик ADO.NET с инвариантным именем «System.Data.SqlServerCe.4.0» либо не зарегистрирован
Я искал похожие проблемы, но еще не нашел решение.
У него установлен SQL CE 4.0.
Я проверил app.config, но кажется, что это хорошо. Она имеет линии, как предложил here
Может кто-нибудь пролить некоторый свет на следующий журнал ошибок?
2015-10-05 09: 59: 54259 [34] ФАТАЛЬНЫЙ - [] Исключение пойманы System.Data.DataException: произошло исключение при инициализации базы данных. Подробнее см. В InnerException. ---> System.Data.Entity.Core.MetadataException: Указанная схема недействительна. Ошибки: (0,0): ошибка 0175: поставщик ADO.NET с инвариантным именем «System.Data.SqlServerCe.4.0» либо не зарегистрирован в файле конфигурации устройства или приложения, либо не может быть загружен. Подробнее см. Внутреннее исключение. на System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Loader.ThrowOnNonWarningErrors() в System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Init (IEnumerable
1 xmlReaders, IEnumerable
1, булевых пути файлов throwOnError, IDbDependencyResolver распознаватель, DbProviderManifest & providerManifest, DbProviderFactory & providerFactory, Строка & providerInvariantName, Строка & providerManifestToken, Memoizer2& cachedCTypeFunction) at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection..ctor(IEnumerable
1 xmlReaders) на System.Data.Entity.Utilities.XDocumentExtensions.GetStorageMappingItemCollection (модель XDocument, DbProviderInfo & providerInfo) на System.Data.Entity. Migrations.Infrastructure.EdmModelDiffer.Diff (XDocument sourceModel, XDocument targetModel, Lazy1 modificationCommandTreeGenerator, MigrationSqlGenerator migrationSqlGenerator, String sourceModelVersion, String targetModelVersion) at System.Data.Entity.Migrations.DbMigrator.IsModelOutOfDate(XDocument model, DbMigration lastMigration) at System.Data.Entity.Migrations.DbMigrator.Upgrade(IEnumerable
1 pendingMigrations, String targetMigrationId, Строка lastMigrationId) на System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists (mustSucceedToKeepDatabase Действие) на System.Data.Entity.MigrateDatabaseToLatestVersion2.InitializeDatabase(TContext context) at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) --- End of inner exception stack trace --- at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() at System.Data.Entity.Internal.RetryAction
1.PerformAction (TInput вход) в System.Data. Entity.Internal.LazyInternalContext.InitializeDatabaseAction (Действие1 action) at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) at System.Data.Entity.Internal.Linq.InternalSet
1.Initialize() в System.Data.Entity.Internal.Linq.InternalSet1.get_InternalContext() at System.Data.Entity.Infrastructure.DbQuery
1.System.Linq.IQueryable.get_Provider() в System.Linq.Queryable.FirstOrDefault [ TSource] (IQueryable1 source, Expression
1 предикат) на TWP.Areas.Core.Models.Authorization.DatabaseMembershipProvider.ValidateUser (String userName, String password) на TW P.Areas.Core.Models.Account.AccountProvider.Logon (членство TwpMembershipProvider, модель LogOnViewModel) на TWP.Areas.Core.Controllers.AccountController.LogOn (модель LogOnViewModel, String returnUrl) на lambda_method (Closure, ControllerBase, Object [ ]) at System.Web.Mvc.ReflectedActionDescriptor.Execute (ControllerContext controllerContext, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary
2 параметра) at System.Web.Mvc.ControllerActionInvoker. <> c__DisplayClass15.b__12() at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter (IActionFilter фильтр, ActionExecutingContext preContext, Func1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func
1 продолжение) на System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter (IActionFilter фильтр, ActionExecutingContext preContext, Func1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func
1 продолжение) в System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters (ControllerContext controllerContext , IList1 filters, ActionDescriptor actionDescriptor, IDictionary
2 параметра) на System.Web.Mvc.ControllerActionInvoker.InvokeAction (ControllerContext controllerContext, String ActionName)
Web.config:
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=152368
-->
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
<section name="twpSettings" type="TWP.Areas.Core.Models.Settings.TwpSettingsSection, TWP"/>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</configSections>
<!-- Path to the configuration file for custom TWP settings -->
<twpSettings configSource="Config\Twp.config"/>
<appSettings>
<!-- Setting for increasing the max size of http requests -->
<add key="aspnet:MaxHttpCollectionKeys" value="10000"/>
<!-- Path to the configuration file for log4net -->
<add key="log4net.Config" value="Config\log4net.config"/>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
</appSettings>
<connectionStrings>
<add name="ADConnectionString1" connectionString="xxxxxx,OU=xxxxxx,DC=xxxxxx,DC=xxx"/>
<add name="TWPConnectionString" connectionString="Data Source=xxxxxx;Initial Catalog=xxxxxxxxx;Persist Security Info=True;User ID=xxxxxxxxxx;Password=xxxxxxxxxxxxxxx" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<customErrors mode="Off"/>
<compilation debug="false" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
<!-- Default culture -->
<globalization uiCulture="en-GB" culture="en-GB"/>
<authentication mode="Forms">
<forms loginUrl="~/Core/Account/LogOn" timeout="2880"/>
</authentication>
<pages>
<namespaces>
<add namespace="System.Web.Helpers"/>
<add namespace="System.Web.Mvc"/>
<add namespace="System.Web.Mvc.Ajax"/>
<add namespace="System.Web.Mvc.Html"/>
<add namespace="System.Web.Routing"/>
<add namespace="System.Web.WebPages"/>
<add namespace="TWP.Areas.Core.Models"/>
</namespaces>
</pages>
<httpRuntime maxRequestLength="10240"/>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="1.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages.Deployment" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="1.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Razor" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.serviceModel>
<!-- Clients -->
<client>
(removed)
</client>
<!-- Services -->
<services>
(removed)
</services>
<!-- Service Hosting Environment -->
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
<!-- Bindings -->
<bindings>
<wsHttpBinding>
<binding name="wsHttpBinding_DccWcfLibrary" closeTimeout="00:00:10" openTimeout="00:00:10" sendTimeout="00:00:10" maxReceivedMessageSize="4194304" />
</wsHttpBinding>
<webHttpBinding>
<binding name="webHttpBinding_Large" maxReceivedMessageSize="1655360">
<readerQuotas maxDepth="32" maxStringContentLength="163840" maxArrayLength="163840" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None" />
</binding>
</webHttpBinding>
</bindings>
<!-- Behaviors -->
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="geocodingBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
</providers>
</entityFramework>
</configuration>
Вам необходимо проверить web.config, а не app.config - и предложить вам поделиться своим web.config, затем – ErikEJ
Спасибо. Web.config теперь добавлен в исходное сообщение. – Mick
Вам нужны настройки конфигурации, которые добавляет пакет EntityFramework.SqlServerCompact в ваш web.config – ErikEJ