[SOLVED] WebClient exception | Windows 10 spring 2018 update

Please report bugs here. If you are unsure whether something is a bug or an expected behavior, please post it on the "Technical Support" forum instead, and wait for a moderator to handle/move the post.
TobiasDonaubauer
Posts: 15
Joined: Wed Nov 04, 2015 5:29 am

[SOLVED] WebClient exception | Windows 10 spring 2018 update

Postby TobiasDonaubauer » Wed May 02, 2018 5:30 am

Since the current Windows 10 spring 2018 update, this code:

Code: Select all

  var webClient = new WebClient();
  webClient.Encoding = Encoding.UTF8;
  webClient.Headers[HttpRequestHeader.Accept] = "application/json";


throws an exception when running in the browser:

Uncaught Error: Type 'System.Text.UTF8Encoding+UTF8EncodingSealed' has not been defined.
at Object.JSIL.RuntimeError (JSIL.Core.js:10531)
at Object.JSIL.GetTypeByName (JSIL.Core.js:1100)
at JSIL.TypeRef.getNoInitialize (JSIL.Core.js:1818)
at InitFieldDefault (JSIL.Core.js:6910)
at PreInitField_Cleanup (JSIL.Core.js:677)
at JSIL.PreInitMembrane.cleanup (JSIL.Core.js:652)
at JSIL.PreInitMembrane.bound_cleanup [as cleanup] (JSIL.Core.js:595)
at JSIL.PreInitMembrane.maybeInit (JSIL.Core.js:616)
at JSIL.PreInitMembrane.bound_maybeInit [as maybeInit] (JSIL.Core.js:592)
at Object.JSIL.InitializeType (JSIL.Core.js:4528)


I am currently using Visual Studio 2017. Before the update everything worked fine!

I tried it in Chrome and Edge. Both run into the same exception.

joaofig
Posts: 9
Joined: Sat Oct 28, 2017 6:32 am

Re: WebClient exception | Windows 10 spring 2018 update

Postby joaofig » Thu May 03, 2018 8:15 am

Same here. Any known workaround? We are using the WebClient class to access our REST APIs.

JS-Support @Userware
Site Admin
Posts: 912
Joined: Tue Apr 08, 2014 3:42 pm

Re: WebClient exception | Windows 10 spring 2018 update

Postby JS-Support @Userware » Fri May 04, 2018 6:03 am

Hi,

Thanks for reporting this issue.

Can you please try the REST demo in the sample showcase app?

To do so, in VS, click "File -> New Project -> CS/XAML for HTML5 -> Sample Showcase", then run it, click "WCF", and try out the REST demo.

Thanks,
Regards,
JS-Support

TobiasDonaubauer
Posts: 15
Joined: Wed Nov 04, 2015 5:29 am

Re: WebClient exception | Windows 10 spring 2018 update

Postby TobiasDonaubauer » Fri May 04, 2018 9:31 am

Same issue. See image

issue.png
issue.png (135.24 KiB) Viewed 697 times

JS-Support @Userware
Site Admin
Posts: 912
Joined: Tue Apr 08, 2014 3:42 pm

Re: WebClient exception | Windows 10 spring 2018 update

Postby JS-Support @Userware » Fri May 04, 2018 9:59 am

Thanks! We are going to fix it asap.

JS-Support @Userware
Site Admin
Posts: 912
Joined: Tue Apr 08, 2014 3:42 pm

Re: WebClient exception | Windows 10 spring 2018 update

Postby JS-Support @Userware » Mon May 07, 2018 7:07 am

Hi,

We haven't had the chance to try out the Spring update yet, but we may have found a solution.

Can you please try to apply the following hotfix and let me know if it fixes the issue?

Here is the hotfix:

1. Download the following ZIP file:
CSHTML5 v1.1.2 hotfix1.zip
(77.15 KiB) Downloaded 20 times


2. Extract it on your disk

3. Copy the file "CSharpXamlForHtml5.Compiler.dll" from the extracted file into the following folder:
C:\Program Files (x86)\MSBuild\CSharpXamlForHtml5\InternalStuff\Compiler

Make sure to replace the existing file. If there is no file to replace, you are probably copying it to the wrong location.

4. Rebuild your project.


Thank you.
Regards,
JS-Support

TobiasDonaubauer
Posts: 15
Joined: Wed Nov 04, 2015 5:29 am

Re: WebClient exception | Windows 10 spring 2018 update

Postby TobiasDonaubauer » Mon May 07, 2018 7:55 pm

It fixed the issue! Thanks a lot for your support.

JS-Support @Userware
Site Admin
Posts: 912
Joined: Tue Apr 08, 2014 3:42 pm

Re: WebClient exception | Windows 10 spring 2018 update

Postby JS-Support @Userware » Wed May 09, 2018 6:00 am

TobiasDonaubauer wrote:It fixed the issue! Thanks a lot for your support.


Thanks!

JS-Support @Userware
Site Admin
Posts: 912
Joined: Tue Apr 08, 2014 3:42 pm

Re: WebClient exception | Windows 10 spring 2018 update

Postby JS-Support @Userware » Tue Jul 10, 2018 7:33 am

The fix is now part of v1.2 beta 1 and newer, available at:
http://forums.cshtml5.com/viewforum.php?f=6


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 5 guests