xsharp.eu • XS0426 : The type name 'Default' does not exist in the type 'System.Text.Encodin
Page 1 of 1

XS0426 : The type name 'Default' does not exist in the type 'System.Text.Encodin

Posted: Thu Jul 13, 2023 1:03 pm
by baramuse
Hi all,

since this morning (and after an upgrade from VS2022 Community 17.6.4 to 17.6.5) I have this error while compiling :
XS0426 : The type name 'Default' does not exist in the type 'System.Text.Encoding'

I reverted to 17.6.4 and still the same issue.

If I debug/break anywhere and I explore 'System.Text.Encoding' it does exists so I don't know why it would not compile.

Target framework is 4.8.1.

Any idea/suggestion ?

​​​​​​​Regards

XS0426 : The type name 'Default' does not exist in the type 'System.Text.Encodin

Posted: Thu Jul 13, 2023 1:06 pm
by robert
A Quick guess (you did not include source code):
You typed System.Encoding.Default DOT something
but the Default in this case is an object, so you had to type
System.Encoding.Default COLON something
You can also enable the compiler option to allow the DOT operator for instance members.

Robert

XS0426 : The type name 'Default' does not exist in the type 'System.Text.Encodin

Posted: Thu Jul 13, 2023 1:49 pm
by baramuse
indeed that was that ! 
Silly mistake.

Thanks again !