[英]IIS - Website - Browse - Parse Error Message: an error occurred while parsing entity name : line 5 position 51
如果我然后刪除該部分(但是在另一台機器上工作正常)它仍然會為另一個實體名稱拋出相同的錯誤:第 5 行位置 51;
在這里更改 web 配置中的行時仍然具有相同的第 5 行位置 51 錯誤
這里是 XML Web 配置文件:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="common">
<section name="logging"
type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
</configSections>
<appSettings file="..\..\AppSecrets.config">
<add key="cors" value="localhost;localhost2; ;" />
<add key="connection" value="web" />
<add key="waitandretry" value="3" />
<add key="circuitbreaker" value="3" />
<add key="circuitbreakertime" value="5" />
<add key="apikey" value="xxxxxx" />
</appSettings>
<common>
<logging>
<factoryAdapter type="Common.Logging.NLog.NLogLoggerFactoryAdapter,
Common.Logging.NLog4411">
<arg key="configType" value="INLINE" />
</factoryAdapter>
</logging>
</common>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
internalLogFile="C:\inetpub\wwwroot\sms\MyAPI\logs\InnerLog.txt"
internalLogLevel="Error" autoReload="true">
<extensions>
<add assembly="NLog.WindowsEventLog" />
</extensions>
<targets>
<target xsi:type="File" name="log"
fileName="${basedir}\logs\${date:format=yyyy-MM-dd}.log"
layout="${longdate} ${uppercase:${level}} ${message}" />
<target xsi:type="EventLog" name="eventlog" source="testlogging"
log="Application"
layout="${message}${newline}${exception:format=ToString}" />
</targets>
<rules>
<logger name="*" minlevel="Error" writeTo="log" />
<logger name="*" minLevel="Error" writeTo="eventlog" />
</rules>
</nlog>
<system.web>
<trace enabled="true" />
<compilation targetFramework="4.7.2" />
<httpRuntime targetFramework="4.6.1" />
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers"
publicKeyToken="xxxxxx" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc"
publicKeyToken="xxxxxx" />
<bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages"
publicKeyToken="xxxxx" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json"
publicKeyToken="xxxxx" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin"
publicKeyToken="xxxxx" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Cors"
publicKeyToken="xxxxx" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.6.0" newVersion="5.2.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http"
publicKeyToken="xxxxx" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.6.0" newVersion="5.2.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting"
publicKeyToken="xxxxx" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.6.0" newVersion="5.2.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http.Owin"
publicKeyToken="xxx" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.6.0" newVersion="5.2.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Autofac" publicKeyToken="xxxxxx"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.8.1.0" newVersion="4.8.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Autofac.Integration.WebApi"
publicKeyToken="xxxxx" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Autofac.Integration.Owin"
publicKeyToken="xxxxx" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
type="
Microsoft.CodeDom.Providers.DotNetCompilerPlatform.
CSharpCodeProvider,
Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0,
Culture=neutral, PublicKeyToken=xxxxx" warningLevel="4"
compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
type=
"Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider,
Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0,
Culture=neutral, PublicKeyToken=xxxx" warningLevel="4"
compilerOptions="/langversion:default /nowarn:41008
/define:_MYTYPE=\"Web\" /optionInfer+" />
</compilers>
</system.codedom>
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*"
type="System.Web.Handlers.TransferRequestHandler"
preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
<defaultDocument>
<files>
<add value="/swagger" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
檢查您的 : AppSecrets.config 中的 & 字符,有時錯誤號指的是該文件
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.