error: This operation would create an incorrectly structured document(错误:此操作将创建结构不正确的文档)
问题描述
我一直在尝试安装实体框架6,它总是回滚并出现错误
I keep trying to install the entity framework 6 and it always rolls back with the error of
error: This operation would create an incorrectly structured document.
我已经卸载了对该位置提到的每个 dll 的所有引用.http://entityframework.codeplex.com/wikipage?title=Updating%20Applications%20to%20use%20EF6
I've uninstalled all the references to every dll mentioned at this location. http://entityframework.codeplex.com/wikipage?title=Updating%20Applications%20to%20use%20EF6
疯狂的是,我可以创建一个新项目,创建一个 webAPI 程序,并尝试添加 Entity Framework 6,但我得到了同样的错误,即使在删除了对 System.Data.Entity.dll 的所有引用之后也是如此 我已经了解了几天,需要认真的帮助.
The crazy thing is that i can create a new project, create a webAPI program, and attempt to add Entity Framework 6 and I get the same error, even after removing all references to System.Data.Entity.dll I'm already a few days into this, and needing serious help.
如何安装 Entity Framework 6?
what can i do to get Entity Framework 6 to install?
注意:它只会安装 find 到类库,而不是 WebApi 或 MVC 应用程序.
Note: It will install just find to a class library just not a WebApi or MVC application.
如果有帮助,这里有一些更详细的错误信息.
If it helps here is some more detailed error info.
PM> Install-Package EntityFramework -Version 6.0.0
Installing 'EntityFramework 6.0.0'.
Successfully installed 'EntityFramework 6.0.0'.
Adding 'EntityFramework 6.0.0' to AC.
Successfully added 'EntityFramework 6.0.0' to AC.
System.InvalidOperationException: This operation would create an incorrectly structured document.
at System.Xml.Linq.XDocument.ValidateDocument(XNode previous, XmlNodeType allowBefore, XmlNodeType allowAfter)
at System.Xml.Linq.XDocument.ValidateNode(XNode node, XNode previous)
at System.Xml.Linq.XContainer.AddNodeSkipNotify(XNode n)
at System.Xml.Linq.XContainer.AddContentSkipNotify(Object content)
at System.Xml.Linq.XContainer.Add(Object content)
at System.Data.Entity.Migrations.Extensions.XContainerExtensions.GetOrCreateElement(XContainer container, String elementName, XAttribute[] attributes)
at System.Data.Entity.ConnectionFactoryConfig.ConfigFileManipulator.AddOrUpdateConfigSection(XDocument config, Version entityFrameworkVersion)
at System.Data.Entity.ConnectionFactoryConfig.InitializeEntityFrameworkCommand.<>c__DisplayClass3.<Execute>b__1(XDocument c)
at System.Data.Entity.ConnectionFactoryConfig.ConfigFileProcessor.ProcessConfigFile(ProjectItem configItem, IEnumerable`1 manipulators)
at System.Data.Entity.ConnectionFactoryConfig.InitializeEntityFrameworkCommand.<>c__DisplayClass3.<Execute>b__0(ProjectItem i)
at System.Data.Entity.ConnectionFactoryConfig.ConfigFileFinder.FindConfigFiles(ProjectItems items, Action`1 action)
at System.Data.Entity.ConnectionFactoryConfig.InitializeEntityFrameworkCommand.Execute()
at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
Uninstalling 'EntityFramework 6.0.0'.
Successfully uninstalled 'EntityFramework 6.0.0'.
Install failed. Rolling back...
Install-Package : This operation would create an incorrectly structured document.
At line:1 char:16
+ Install-Package <<<< EntityFramework -Version 6.0.0
+ CategoryInfo : NotSpecified: (:) [Install-Package], RuntimeException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
推荐答案
升级实体框架时,app.config 或 web.config 文件将写入内容.我怀疑这可能是问题所在.查看您的 app.config 或 web.config 文件.也许 EF 升级无法在没有生成无效 xml 文档的情况下写入它们.
When Entity Framework is upgraded, the app.config or web.config files will get stuff written into them. I suspect that might be the problem. Take a look at your app.config or web.config files. Maybe the EF upgrade is having trouble writing to them without making an invalid xml document.
这篇关于错误:此操作将创建结构不正确的文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:错误:此操作将创建结构不正确的文档
基础教程推荐
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- rabbitmq 的 REST API 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 如何激活MC67中的红灯 2022-01-01