-1
什麼是錯的這個計劃爲什麼我得到錯誤xpected XmlNodeType.Element,類型是Whitespace?
var modifiedXML = @" <system.webServer><rewrite><rules><rule name='rule 1D' stopProcessing='false'><match url='^(.*)$'/><!--<action type= 'Rewrite' url='//offline.html'/>--></rule></rules></rewrite></system.webServer>";
var configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");
var section = configuration.GetSection("system.webServer");
section.SectionInformation.SetRawXml(modifiedXML);
configuration.Save();
錯誤:
An exception of type 'System.Configuration.ConfigurationErrorsException' occurred in System.Configuration.dll but was not handled in user code
Additional information: expected XmlNodeType.Element, type is Whitespace.
非常感謝....我會很快接受你的。 –