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

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
baramuse
Posts: 87
Joined: Tue Nov 29, 2022 8:31 am
Location: France

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

Post 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
User avatar
robert
Posts: 4352
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

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

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
baramuse
Posts: 87
Joined: Tue Nov 29, 2022 8:31 am
Location: France

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

Post by baramuse »

indeed that was that ! 
Silly mistake.

Thanks again !
Post Reply