我非常擅长设置SQL Server数据库并连接到它(Visual Studio 2012 for Web)。我已经下载了SQL Server 2014,并且在我的服务中运行了SQL Server(Express)。
我对下一步应该是什么一无所知,我使用SQL Server Express在Database Explorer视图中设置数据连接,但是当我在Package Manager Console中尝试update-database
时,我得到了
提供程序未返回ProviderManifest实例
这可能是因为我的连接字符串错误。
连接字符串:
<add name="DefaultConnection"
connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=RecreationalServices;Integrated Security=False"
providerName="System.Data.SqlClient" />
全文错误代码
PM> update-database
没有待定的基于代码的迁移。
System.Data.ProviderIncompatibleException:提供程序未返回ProviderManifest实例。 ---&GT; System.ArgumentException:无法确定存储版本;需要有效的存储连接或版本提示 在System.Data.SqlClient.SqlVersionUtils.GetSqlVersion(String versionHint)
在System.Data.SqlClient.SqlProviderManifest..ctor(String manifestToken)
在System.Data.SqlClient.SqlProviderServices.GetDbProviderManifest(String versionHint)
在System.Data.Common.DbProviderServices.GetProviderManifest(String manifestToken)
---内部异常堆栈跟踪结束---
在System.Data.Common.DbProviderServices.GetProviderManifest(String manifestToken)
在System.Data.Metadata.Edm.StoreItemCollection.Loader.InitializeProviderManifest(Action3 addError)
3 addError)
at System.Data.Metadata.Edm.StoreItemCollection.Loader.OnProviderManifestTokenNotification(String token, Action
在System.Data.EntityModel.SchemaObjectModel.Schema.HandleProviderManifestTokenAttribute(XmlReader reader)
在System.Data.EntityModel.SchemaObjectModel.Schema.HandleAttribute(XmlReader阅读器)
在System.Data.EntityModel.SchemaObjectModel.SchemaElement.ParseAttribute(XmlReader reader)
在System.Data.EntityModel.SchemaObjectModel.SchemaElement.Parse(XmlReader阅读器)
在System.Data.EntityModel.SchemaObjectModel.Schema.HandleTopLevelSchemaElement(XmlReader阅读器)
在System.Data.EntityModel.SchemaObjectModel.Schema.InternalParse(XmlReader sourceReader,String sourceLocation)
在System.Data.EntityModel.SchemaObjectModel.Schema.Parse(XmlReader sourceReader,String sourceLocation)
at System.Data.EntityModel.SchemaObjectModel.SchemaManager.ParseAndValidate(IEnumerable1 xmlReaders, IEnumerable
1 sourceFilePaths,SchemaDataModelOption dataModel,AttributeValueNotification providerNotification,AttributeValueNotification providerManifestTokenNotification,ProviderManifestNeeded providerManifestNeeded,IList1& schemaCollection)
1 xmlReaders,IEnumerable
at System.Data.Metadata.Edm.StoreItemCollection.Loader.LoadItems(IEnumerable1 sourceFilePaths)
1 xmlReaders,IEnumerable
at System.Data.Metadata.Edm.StoreItemCollection.Init(IEnumerable1 filePaths, Boolean throwOnError, DbProviderManifest& providerManifest, DbProviderFactory& providerFactory, String& providerManifestToken, Memoizer
2&amp; cachedCTypeFunction)
在System.Data.Metadata.Edm.StoreItemCollection..ctor(IEnumerable1 xmlReaders)
1 pendingMigrations,String targetMigrationId,String lastMigrationId)
at System.Data.Entity.Migrations.Extensions.XDocumentExtensions.GetStoreItemCollection(XDocument model, DbProviderInfo& providerInfo)
at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.Diff(XDocument sourceModel, XDocument targetModel, String connectionString)
at System.Data.Entity.Migrations.DbMigrator.IsModelOutOfDate(XDocument model, DbMigration lastMigration)
at System.Data.Entity.Migrations.DbMigrator.Upgrade(IEnumerable
在System.Data.Entity.Migrations.Infrastructure.MigratorLoggingDecorator.Upgrade(IEnumerable`1 pendingMigrations,String targetMigrationId,String lastMigrationId)
在System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration)
在System.Data.Entity.Migrations.Infrastructure.MigratorBase.Update(String targetMigration)
在System.Data.Entity.Migrations.Design.ToolingFacade.UpdateRunner.RunCore() 在System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.Run() 提供程序未返回ProviderManifest实例。
答案 0 :(得分:0)
尝试将集成安全性从False更改为True。
答案 1 :(得分:0)