Article | 70002288 |
Type | Bug |
Product | Engine |
Version | 1001 |
Date Added | 12/12/2022 |
Fixed | 10.1002.0.6 (12/13/2022) |
Submitted by | Ikenna Aniobodo |
Summary
open Dxf is thrown an Exception under net core 6
Solution
The problem is that Microsoft removed codepages from core and has only 7 default codepages.
Unfortunatelly DXF is a text format and uses multiple codepages and also has a definition for a codepage at the Header of the file.
Therefore a solution to this issue is to add the codepages to your project like below.
This solution is for a core project and Visual Studio 2022 and above.
Open the Terminal (View->Terminal) and navigate to the Project's directory.
There type the following command : dotnet add package System.Text.Encoding.CodePages
Then go to the initialization of the form and add the following code : Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
This way the codepages.dll will be added to the project.