[SOLVED] WebClient exception | Windows 10 spring 2018 update
Posted: Wed May 02, 2018 5:30 am
Since the current Windows 10 spring 2018 update, this code:
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.
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.