Visual Studio 2012 包管理器控制台名称不能以“<"开头特点 [英] Visual studio 2012 package manager console Name cannot begin with the '<' character

查看:23
本文介绍了Visual Studio 2012 包管理器控制台名称不能以“<"开头特点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人遇到过这个问题,或者可以帮助找出这个错误的来源?当我加载项目时(它只发生在这个项目上,没有发生在我的其他项目上),PM 在控制台中给了我这个错误:

Has anyone run into this issue before or can help find out where the source of this error is coming from? When I load the project (and it only occurs on this project, none of my others), PM gives me this error in console:

名称不能以<"开头字符,十六进制值 0x3C.第 1 行,位置 2.

我正在 Visual Studio 2012 中为 .net 4 运行 MVC4.这仅在我更新 nuget 包管理器后才开始发生.因此,我无法运行任何 EF 迁移命令来更新数据库.

I'm running MVC4 for .net 4 in Visual Studio 2012. This only started to occur after I updated nuget package manager. As a result, I can't run any EF migrations commands to update database.

PMC 在启动项目后立即显示错误.我尝试在我的域和 Web 项目中选择管理 nuget 包".域项目运行良好,但我在 Web 项目的已安装包"和更新"选项卡中看到了同样的错误.如果我从packages.config 中删除条目,则它不再显示错误并显示无.但是,除了 install-package 之外,我仍然无法在 PMC 上运行任何命令.即使尝试运行 update-package 也会给我:

PMC displays the error immediately upon launching the project. I tried to select 'manage nuget packages' on my domain and web projects. Domain project worked fine, but I see this same error in the 'Installed packages' and 'Updates' tabs for the web project. If I remove the entries from the packages.config, then it doesn't show the error anymore and says none. However, I still cannot run any commands on PMC other than install-package. Even trying to run update-package will give me:

update-package : 名称不能以<"开头字符,十六进制值 0x3C.第 1 行,位置 2.

我尝试查看我能找到的所有 xml、设置和 xml 文件,但没有发现任何异常或损坏.有谁知道我如何追踪这个错误?

I tried to go through all the xml, settings, and xml files I could find but haven't found any anomalies or corruptions. Does anyone know how I can trace this error?

推荐答案

当您最初在 Visual Studio 中打开解决方案时,任何已安装的包都将运行包内的Init.ps1"脚本(如果有).

When you initially open a solution in Visual Studio, any installed packages will run the "Init.ps1" script within the package (if it has one).

听起来像 EF 包可能是罪魁祸首,从记忆中我知道它有一个 Init.ps1,所以可能值得完全删除该包(手动,只需删除所有内容)并重新安装.

Sounds like the EF package might be the culprit, and from memory I know it has an Init.ps1, so might be worth removing that package entirely (manually, just delete everything) and reinstalling it.

这篇关于Visual Studio 2012 包管理器控制台名称不能以“&lt;"开头特点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆