سؤال

I have been using EF - Code First for a while on a project, with everything working ok.

I recently got a new computer, installed Visual Studio and SQL Server. I then opened up the visual studio solution and tried to recreate my database using the update-database command.

I am getting this error. Any ideas of how to fix it?

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.
هل كانت مفيدة؟

المحلول

I fixed it! Check your web-config file if you come across this problem. It was a typo in the file.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top