MissingMethodException: Method not found: 'Void Aspose'

Hello, today few hours ago we started getting error
System.MissingMethodException: Method not found: 'Void Aspose.Words.Cloud.Sdk.Model.Requests.ConvertDocumentRequest…ctor(System.IO.Stream, System.String, System.String, System.String, System.String, System.String)
We did not change anyting on our side. Could you, please help us to solve this issue?

@Dmytro_K

Issue Overview

You are receiving a System.MissingMethodException when trying to create a ConvertDocumentRequest:

Method not found: 'Void Aspose.Words.Cloud.Sdk.Model.Requests.
ConvertDocumentRequest..ctor(System.IO.Stream, System.String,
System.String, System.String, System.String, System.String)'

This exception usually means that the runtime version of the Aspose.Words Cloud SDK does not contain a constructor with the signature you are calling. In other words, there is a version mismatch between the compiled code and the library that is being loaded at runtime.


Common Causes

Cause What to check
Out‑of‑date NuGet package Verify the version of Aspose.Words.Cloud.Sdk referenced in your project.
Mixing different SDK versions Ensure all Aspose‑Words‑Cloud assemblies (and transitive dependencies) come from the same package version.
Breaking changes in a newer SDK The constructor signature may have been changed/obsolete in a newer release.
Old binary still in the output folder A previous version of the DLL may be left in bin\Debug/bin\Release.

Quick Fix Steps

  1. Upgrade to the latest SDK

    dotnet add package Aspose.Words.Cloud.Sdk --version 23.12.0   # replace with the newest version
    

    Or use the NuGet Package Manager UI to update the package.

  2. Clean and rebuild

    • Delete the bin and obj folders.
    • Re‑build the solution to make sure the new DLL is the only one present.
  3. Verify the constructor signature
    Starting from 23.9 the ConvertDocumentRequest constructors were streamlined. The most common overload is:

    var request = new ConvertDocumentRequest(
        document: System.IO.File.OpenRead("input.docx"),
        format: "pdf",
        outPath: null,               // optional – set to null if you want the result as a stream
        password: null,              // optional – document password
        folder: null,                // optional – cloud folder
        storage: null);              // optional – storage name
    

    Do not pass six string parameters; the Stream‑based overload expects only 6 arguments (Stream + 5 optional strings). If you need to pass a file name instead of a stream, use the overload that takes string name as the first argument.

  4. Check for multiple SDK copies
    Search your solution for any stray Aspose.Words.Cloud.Sdk.dll files that might be copied from another project or a local libs folder.


Example – Converting a DOCX to PDF (Cloud SDK)

using Aspose.Words.Cloud.Sdk;
using Aspose.Words.Cloud.Sdk.Model.Requests;
using System.IO;

// 1️⃣ Initialise the API client
var config = new Configuration
{
    ClientId = "YOUR_CLIENT_ID",
    ClientSecret = "YOUR_CLIENT_SECRET"
};
var wordsApi = new WordsApi(config);

// 2️⃣ Prepare the request (stream‑based)
using (var inputStream = File.OpenRead(@"C:\Docs\sample.docx"))
{
    var convertRequest = new ConvertDocumentRequest(
        document: inputStream,   // Stream containing the source document
        format: "pdf",           // Desired output format
        outPath: null,           // Return the result as a stream
        password: null,
        folder: null,
        storage: null);

    // 3️⃣ Execute the conversion
    var response = wordsApi.ConvertDocument(convertRequest);

    // 4️⃣ Save the PDF stream to a file
    using (var outputFile = File.Create(@"C:\Docs\sample_converted.pdf"))
    {
        response.Document.CopyTo(outputFile);
    }
}

Note: Replace YOUR_CLIENT_ID and YOUR_CLIENT_SECRET with the credentials from your Aspose Cloud dashboard.


Further Diagnostics (if the problem persists)

  • Provide the exact SDK version you are referencing (check packages.config or .csproj).
  • Show the code line where you instantiate ConvertDocumentRequest.
  • Confirm the target framework (e.g., .NET 6, .NET 48). Some older SDK versions were built for .NET Standard 2.0 only.

You can also enable assembly binding logging to verify which DLL is being loaded at runtime.


Useful Links


TL;DR

  1. Update Aspose.Words.Cloud.Sdk to the latest version.
  2. Clean and rebuild the project.
  3. Use the correct ConvertDocumentRequest overload (Stream + up to 5 optional strings).

If you follow these steps and still encounter the exception, please reply with:

  • The exact SDK version you are using.
  • The snippet that creates ConvertDocumentRequest.

We’ll dive deeper from there.

Happy coding! :rocket:

Please share the version of the SDK you use and the code that is failing on your side

Hello, Yaroslaw.
Update, we stopped getting this errors after 3 am.

It’s good that the error is gone. If you start getting that error again, please share more information.