We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Could not load System.CodeDom

Hi, i added from nuget Aspose.Words (23.2.0). my project is wcf service net 6.0.

then added this code:

public void Pdf2Doc(string pathFileDoc)
{
    Document pdf = new Document(pathFileDoc);
    pdf.Save(Path.ChangeExtension(pathFileDoc, "docx"));
}

when run the application get this error:

System.IO.FileNotFoundException: 'Could not load file or assembly 'System.CodeDom, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. 

what can i do to fix it?

thanks.

@fabriziodb I cannot reproduce your problem, can you please provide more details about your environment, and add the Stack Trace of the exception?

now the erroor is changed, maybe aspose.words use SkiaSharp?

do i have to add SkiaSharp from nuget too?

{ “time”: “2023-02-21 21:06:13.7847”, “level”: “ERROR”, “message”: "Plugin C:\Webs\DWA\plugins\JsonData.DWA Error: Could not load file or assembly ‘SkiaSharp, Version=2.80.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756’. The system cannot find the file specified., InnerException: , StackTrace: ", “eventProperties”: { “environment”: “Development”, “data”: null } }

@fabriziodb Yes, Aspose.Words has a dependency on SkiaSharp.
https://www.nuget.org/packages/Aspose.Words#dependencies-body-tab
But Aspose.Words requires SkiaSharp 2.80.1 version or higher. In your exception message 2.80.0.0 version is requested.
I would suggest you to install Aspose.Words from NuGet, in this case all required dependencies will be installed automatically.

1 Like