WinBatch® Technical Support Forum

All Things WinBatch => WebBatch => Topic started by: JTaylor on April 29, 2020, 08:51:06 AM

Title: Configuration system failed to initialize
Post by: JTaylor on April 29, 2020, 08:51:06 AM
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?

Jim

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

    System.Configuration
    Configuration system failed to initialize


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

<configSections>

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

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

  </sectionGroup>

 
 
</configSections>
<startup>

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

</system.data>
</configuration>
Title: Re: Configuration system failed to initialize
Post by: td on April 29, 2020, 10:04:58 AM
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.

Title: Re: Configuration system failed to initialize
Post by: JTaylor on April 29, 2020, 10:41:51 AM
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.

Jim
Title: Re: Configuration system failed to initialize
Post by: td on April 30, 2020, 02:11:38 PM
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?
Title: Re: Configuration system failed to initialize
Post by: JTaylor on April 30, 2020, 04:20:54 PM
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.

Jim
Title: Re: Configuration system failed to initialize
Post by: td on May 01, 2020, 09:00:12 AM
If you don't mind sharing, it will be interesting to hear how you resolve the problem.  And I need to set aside some time to brush up on the perils of dotNet assembly config file usage. Enquiring minds want to know... 
Title: Re: Configuration system failed to initialize
Post by: JTaylor on May 01, 2020, 09:19:52 AM
Will do.   

Jim