This program works just fine when compiled for .NET 4 but does when compiled for .NET Core. I understand the error about encoding not supported but not how to fix it.
Public Class Program
Public Shared Function Main(ByVal args As String()) As Integer
System.Text.Encoding.GetEncoding(1252)
End Function
End Class
Please write:
in csproj.
In package console write ' dotnet restore', restore assemblies.
and wite this code for sample:
To do this, you need to register the
CodePagesEncodingProvider
instance from theSystem.Text.Encoding.CodePages
package.To do that, install the System.Text.Encoding.CodePages package:
Then (after implicitly or explicitly running
dotnet restore
) you can call:Alternatively, if you only need that one code page, you can get it directly, without registration: