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

Free Support Forum - aspose.com

MissingMethodException: Aspose.Words.DocumentBuilder.InsertImage

Recently, when working with Aspose.Words 18.10.0, I am seeing:

System.MissingMethodException: 'Method not found: 'Aspose.Words.Drawing.Shape Aspose.Words.DocumentBuilder.InsertImage(SkiaSharp.SKBitmap, Double, Double)'.'

on my machine and on my UAT server, but not on my Azure service when calling a method which contains the above mentioned InsertImage call.

I’m referencing SkiaSharp 1.60.1 in the project, and it is in the bin folder. This previously used to work, but I think i had moved some files manually into the bin folder but did a clean and they were removed.

I’ve tried multiple versions of SkiaSharp and all appear to do the same.

@Brian.Mahocker The only thing I can suspect is that you mistakenly referenced Aspose.Words .NET dll instead of .NET Standard dll. I would suggest you to remove reference to Aspose.Words and to SkiaSharp and then add reference to Aspose.Words from NuGet. It should select the right dll for your application.
If this does not help, please create a simple application that will allow us to reproduce the problem and attach it here.

@alexey.noskov To add some more detail (that I probably should have before), Project A is a .net 4.7 winforms apps which references Project B which is a standard 2.0 project. Project B is the one that references Aspose.Words and SkiaSharp; Project A does not contain any direct references to either.

I’ll create a smaller example project in the meantime, but would that be part of the problem?

@Brian.Mahocker Thank you for additional information. It would be great if you create a simple solution that will allow us to reproduce the problem. It sounds like NuGet improperly resolved the reference to Aspose.Words, but it is difficult to say without a sample application.

FormGenerator.zip (7.0 MB)

Sorry for the delay. Minimum project is attached. I’m referencing Aspose.Words 18.10.0, which I didn’t include for size reasons and SkiaSharp 1.60.1

Thank you for additional information. I checked your project and see that you reference Aspose.Words from both ManualInterfaceUI and FormGenerator projects, which it redundant. It is required to add reference to Aspose.Words only from FormGenerator project. Also, it is not required to separately add reference to SkiaSharp, NuGet automatically resolves package dependencies.
In addition, please add the following section into FormGenerator.csproj

  <PropertyGroup>
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
  </PropertyGroup>

Good to know that; that got me halfway there.

I also needed to copy libskiasharp from Project B’s packages folder to Project A’s bin folder. but all appears to be good. Thanks.

@Brian.Mahocker Yes libskiasharp is required to be copied if you deploy your application to Linux. It is perfect that you managed to resolve your problem. Please feel free to ask in case of any further issues.