簡體   English   中英

實體框架-遷移更新數據庫引發奇怪的錯誤

[英]Entity Framework - Migrations update-database Throwing strange error

我在一個項目上使用EF-Code First已有一段時間,一切正常。

我最近買了一台新計算機,安裝了Visual Studio和SQL Server。 然后,我打開了Visual Studio解決方案,並嘗試使用update-database命令重新創建數據庫。

我收到此錯誤。 關於如何解決的任何想法?

PM> update-database -verbose
Using StartUp project 'AsoRock.Data'.
Using NuGet project 'AsoRock.Data'.
System.Xml.XmlException: 'true' is an unexpected token. The expected token is '"' or '''. Line 17, position 190.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
   at System.Xml.XmlTextReaderImpl.ThrowUnexpec;tedToken(String expectedToken1, String expectedToken2)
   at System.Xml.XmlTextReaderImpl.ParseAttributes()
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
   at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
   at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
   at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
   at System.Data.Entity.Migrations.Utilities.ConfigurationFileUpdater.Update(String configurationFile)
   at System.Data.Entity.Migrations.Design.ToolingFacade..ctor(String migrationsAssemblyName, String contextAssemblyName, String configurationTypeName, String workingDirectory, String configurationFilePath, String dataDirectory, DbConnectionInfo connectionStringInfo)
   at System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade(String configurationTypeName, Boolean useContextWorkingDirectory)
   at System.Data.Entity.Migrations.UpdateDatabaseCommand.<>c__DisplayClass2.<.ctor>b__0()
   at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
'true' is an unexpected token. The expected token is '"' or '''. Line 17, position 190.

我修好了它! 如果遇到此問題,請檢查您的Web配置文件。 這是文件中的錯字。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM