【问题标题】:Entity Framework - Migrations update-database Throwing strange error实体框架 - 迁移更新数据库抛出奇怪的错误
【发布时间】:2014-02-22 20:43:26
【问题描述】:

我在一个项目中使用 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.

【问题讨论】:

  • 更新了帖子...抱歉,出于某种原因,股权转让流程不允许我通过错误

标签: c# sql database entity-framework code-first


【解决方案1】:

我修好了!如果遇到此问题,请检查您的 web-config 文件。这是文件中的错字。

【讨论】:

  • 什么错字,在哪里?一个普通的 web.config 中有很多字符。
猜你喜欢
  • 2014-07-08
  • 2012-11-29
  • 2017-04-08
  • 2017-04-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-07-01
相关资源
最近更新 更多