简体   繁体   English

Visual Studio编辑器的行为很奇怪! 显示每个实例的编译错误

[英]Visual Studio editor is behaving weird! Showing compilation error with every instance

Whenever I compile any website in Visual Studio I face multiple compilation errors but code gets executed perfectly. 每当我在Visual Studio中编译任何网站时,我都会遇到多个编译错误,但是代码会完美执行。 I am supposing that some setting is changed with my vs editor. 我想我的vs编辑器会更改某些设置。

Following are few error from list: 以下是列表中的一些错误:

Illegal syntax. 语法不正确。 Expecting valid start name character. 期望有效的起始名称字符。 D:\\Gourav\\WebSite1\\Demo.aspx D:\\ Gourav \\ WebSite1 \\ Demo.aspx

Character '%', hexadecimal value 0x25 is illegal in an XML name. XML名称中的字符'%',十六进制值0x25是非法的。

The character '@', hexadecimal value 0x40 is illegal at the beginning of an XML name. XML名称开头的字符“ @”(十六进制值0x40)是非法的。

Character '@', hexadecimal value 0x40 is illegal in an XML name. 字符“ @”(十六进制值0x40)在XML名称中是非法的。

Please help!!.. 请帮忙!!..

It's hard to tell without knowing a bit more, but there's a link here about a trying to put a Regex in the web.config like this 不知不觉很难说出来,但是这里有一个链接,试图像这样将正则表达式放入web.config中

<appSettings>
    <add key="SpecialCharacterRegEx" value="[~” # % & * :" < > ? / \ { | }]+"/>
</appSettings>

Which gives compilation errors like this: 这样会产生如下编译错误:

1. Character ' ', hexadecimal value 0x20 is illegal in an XML name
2. Illegal syntax. Expecting valid start namecharacter
3. Application Configuration file"App.config" is invalid

The trick was to replace it with something like: 诀窍是将其替换为以下内容:

<appSettings>
    <add key="SpecialCharacterRegEx" value="[~&quot; # % &amp; * : &lt; &gt; ? / \ { | }]+"/>
</appSettings>

I'll bet your problem is something similar in Demo.aspx. 我敢打赌,您的问题与Demo.aspx中的问题类似。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM