我已經(jīng)從https://aspnetboilerplate.com/Templates下載了Asp.Net MVC 5.x單頁Web應(yīng)用程序。我正在使用MySQL,并按照鏈接https://aspnetboilerplate.com/Pages/Documents/EF-MySql-Integration中提到的步驟進(jìn)行操作。但是,當(dāng)我運(yùn)行Add-Migration命令時,它給出了錯誤。MyCompany.MyProject.Web \ Web.Config:<add name="Default" connectionString="Server=127.0.0.1;port=3306;Database=SparTestDb;uid=root;password=root" providerName="MySql.Data.MySqlClient"/>MyCompany.MyProject.EntityFramework \ Migrations \ Configuration.cspublic Configuration(){ AutomaticMigrationsEnabled = false; ContextKey = "Spar"; SetSqlGenerator("MySql.Data.MySqlClient", new MySql.Data.Entity.MySqlMigrationSqlGenerator());}錯誤:PM> Add-Migration“ AbpZero_Initial” System.NullReferenceException:對象引用未設(shè)置為對象的實(shí)例。在System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection連接)在MySql.Data.MySqlClient.MySqlProviderServices.GetDbProviderManifestToken(DbConnection連接) )在System.Data.Entity.Infrastructure.DefaultManifestTokenResolver。<> c__DisplayClass1.b__0(Tuple 3
k) at
System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey鍵,F(xiàn)unc 2 valueFactory) at
System.Data.Entity.Infrastructure.DefaultManifestTokenResolver.ResolveManifestToken(DbConnection
connection) at
System.Data.Entity.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection
connection, DbProviderManifest& providerManifest) at
System.Data.Entity.DbModelBuilder.Build(DbConnection
providerConnection) at
System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext
internalContext) at
System.Data.Entity.Internal.RetryLazy2.GetValue(TInput輸入)在System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
- 1 回答
- 0 關(guān)注
- 180 瀏覽
添加回答
舉報
0/150
提交
取消