wpf 拉动后无法加载项目:“预期为‘编码’,但发现‘utf-8’。”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15990064/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 08:35:36  来源:igfitidea点击:

Can't load project after pulling: "Expected 'ENCODING' but found 'utf-8'."

c#wpfgitvisual-studio-2012

提问by Tool

After pulling the project (WPF application) from git,

从 git 中拉取项目(WPF 应用程序)后,

I get this error:

我收到此错误:

enter image description here

在此处输入图片说明

What could be causing it? It worked fine before pulling it (someone else commited on the project).

是什么原因造成的?在拉它之前它运行良好(其他人在该项目上提交)。

回答by Tool

It appears there were some unclosed tags in my .csproject file.

我的 .csproject 文件中似乎有一些未关闭的标签。

Strangely though, the error above was reported instead.

奇怪的是,上面的错误反而被报告了。

回答by danigitman

Look at your .csproj extension file search for: <<<<<< or ====== or >>>>>>>> and remove it.

查看您的 .csproj 扩展文件搜索:<<<<<< 或 ====== 或 >>>>>>>> 并将其删除。

also check your web.config file for those symbols and remove them too if they exist there.

还要检查您的 web.config 文件中是否有这些符号,如果它们存在,也将它们删除。

回答by heb89

I had the same issue, I was just missing a closing tag.

我有同样的问题,我只是缺少一个结束标签。

http://www.w3schools.com/xml/xml_validator.asp< try this

http://www.w3schools.com/xml/xml_validator.asp< 试试这个

edit - Try to open your .csproj in an editor and look for the missing tags. You can do this via Visual Studio if you unload your project then edit your project.

编辑 - 尝试在编辑器中打开您的 .csproj 并查找丢失的标签。如果卸载项目然后编辑项目,则可以通过 Visual Studio 执行此操作。

回答by Ziggler

This forum really helped me. Thank you very much. In my case my team mate merged the code and in .csproj there was end tag missing for we had >. I opened .csproj in visual studio. Edited end tag to /> and saved the file and reloaded the project and it was fine.

这个论坛对我很有帮助。非常感谢。在我的情况下,我的队友合并了代码,在 .csproj 中缺少结束标记,因为我们有 >。我在 Visual Studio 中打开了 .csproj。将结束标记编辑为 /> 并保存文件并重新加载项目,它很好。

回答by daniel_aren

I had some strange underscore lines, I am using the tool Git Extensions, maybe this tool added this lines.. I compared a older version in notepad++ and saw this. It didn′t show in Visual Studio.

我有一些奇怪的下划线,我正在使用工具 Git Extensions,也许这个工具添加了这行。我在记事本 ++ 中比较了旧版本并看到了这一点。它没有在 Visual Studio 中显示。