Page 2 of 2

Re: Issues with 2019 install and Invoke-WebRequest

Posted: Mon Feb 25, 2019 3:05 pm
by CodSup01
Hi David,

I appear to have this working now, the scriptdriver64.exe.config looks like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <startup useLegacyV2RuntimeActivationPolicy="true">
      <supportedRuntime version="v4.0" />
      <supportedRuntime version="v2.0" />
      <section name="uri" type="System.Configuration.UriSection, System,                           Version=4.0.0.0, Culture=neutral,                           PublicKeyToken=b77a5c561934e089" />
      <uri>
         <schemeSettings>
            <add name="http|https" genericUriParserOptions="DontUnescapePathDotsAndSlashes" />
         </schemeSettings>
      </uri>
   </startup>
</configuration>

Re: Issues with 2019 install and Invoke-WebRequest

Posted: Mon Feb 25, 2019 3:07 pm
by davidc
The Uri section is valid. In addition, PowerShell.exe's config file has the same section. The only difference is that our config file has the startup element:

Code: Select all

<startup useLegacyV2RuntimeActivationPolicy="true"> 
        <supportedRuntime version="v4.0" />    
	    <supportedRuntime version="v2.0" />
</startup>
1. Does the error still occur if you remove this section?
2. If item 1 works, try inserting the startup element after the uri element.

Re: Issues with 2019 install and Invoke-WebRequest

Posted: Tue Feb 26, 2019 6:00 am
by CodSup01
Hi David,

The issue still occurs after removing the startup config.

Re: Issues with 2019 install and Invoke-WebRequest

Posted: Tue Feb 26, 2019 8:22 am
by davidc
We are updating the ScriptDriver config file as follows:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <startup useLegacyV2RuntimeActivationPolicy="true"> 
        <supportedRuntime version="v4.0" />    
	    <supportedRuntime version="v2.0" />
    </startup>
	<configSections> 
		<section name="uri" type="System.Configuration.UriSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> 
	</configSections> 
	<uri>
		<schemeSettings>
			<add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes"/>
			<add name="https" genericUriParserOptions="DontUnescapePathDotsAndSlashes"/>
		</schemeSettings>
	</uri>
</configuration>
Please verify that this works for you.

Re: Issues with 2019 install and Invoke-WebRequest

Posted: Tue Feb 26, 2019 12:25 pm
by CodSup01
Hi David,

Now receiving the following error:

Only one <configSections> element allowed per config file and if present must be the first child of the root <configuration> element. (C:\Program Files\SAPIEN Technologies, Inc\PowerShell Studio 2019\Debugger64\scriptdriver64.exe.Config line 7)

Re: Issues with 2019 install and Invoke-WebRequest

Posted: Tue Feb 26, 2019 3:03 pm
by davidc
Looks like the configSections element has to be at the top. Try this:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
	<configSections> 
		<section name="uri" type="System.Configuration.UriSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> 
	</configSections> 
    <startup useLegacyV2RuntimeActivationPolicy="true"> 
        <supportedRuntime version="v4.0" />    
	    <supportedRuntime version="v2.0" />
    </startup>
	<uri>
		<schemeSettings>
			<add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes"/>
			<add name="https" genericUriParserOptions="DontUnescapePathDotsAndSlashes"/>
		</schemeSettings>
	</uri>
</configuration>

Re: Issues with 2019 install and Invoke-WebRequest

Posted: Wed Feb 27, 2019 7:47 am
by CodSup01
Hi David,

That did the trick, thanks for all your help.

Re: Issues with 2019 install and Invoke-WebRequest

Posted: Wed Feb 27, 2019 8:40 am
by davidc
I'm glad to hear it and thank you for the update. We will include the new config in the next service release.

Re: Issues with 2019 install and Invoke-WebRequest

Posted: Wed Mar 06, 2019 11:06 am
by davidc
We release a new service build of PowerShell Studio (v5.6.160) with the updated config file.