All Things WinBatch > WebBatch

Configuration system failed to initialize

(1/2) > >>

Ran into a new one.  I *think* I have used CLR stuff with webbatch before without an issue so assuming this is a bit more specific to HtmlAgilityPack.   The error appears to be related to innerText, which makes me think it is related to the use of HttpUtility.HtmlDecode() under System.Web.   My understanding such errors are related to the app.config file.   Have done a lot of reading but still not clear what is needed in the config file.   Assuming that is the issue.     I have listed one of my  MANY attempts with the config file.    Suggestions?


Error#:          1261
Line:            If cNode > 0 Then title = StrTrim(cNode.InnerText)
Error Text:      COM/CLR: Exception
Additional Info: COM/CLR Exception:

    Configuration system failed to initialize

<?xml version="1.0" encoding="utf-8" ?>


  <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" >

    <section name="HtmlAgilityPack.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                     requirePermission="false" />



  <supportedRuntime version="v4.0" sku=".NETFramework,Version=4.6"/>
    <httpRuntime targetFramework="4.6"/>


I am completely out of my depth when it comes to configuration files so I will offer a few random thoughts that are likely completely useless.

* Don't know which web server software you are using.  But if it is IIS, IIS has some very quirky rules about file access.  I have been caught more than once by the server's internet user restrictions that allow WebBatch access to one file in a directory but not another when both files have the same permissions.  The only differences appear to be the file's extension and the API used to access them.
* If you have access to the source code to your assembly, perhaps check the source code for which configuration settings the assembly is looking for.
* Is the location of your config file correct?
* Is the name of your config file correct?

Thanks.  Will give that some attention.  It is IIS.   I let VS do the naming so assume it is correct but will do some more reading to see what the rules are for naming.   I always see app.config or web.config in the reading but VS named it something different.   I went with app.config approach since it was webbatch using it but, again, wasn't certain or if it really matters.

Got to go see a man about some dirt and then back to the next round of head-bashing.   Thanks again.


I am sure you already thought of the possibility but I will mention it anyway. Does the machine running your Web server have the .Net framework version specified in your config file available?

Yes.   That one did cross my mind.   I decided to remove the reference to System.Web from the project since I was only using it once and since nothing I tried seemed to work.  Even the stuff from M.S..  I assume I can call it from within the webbatch script.  Haven't gotten that far.

Thanks again.



[0] Message Index

[#] Next page

Go to full version