Mads
Mads

Reputation: 465

How to fix: The value cannot be null or empty. (Parameter 'mediaType')

In my .NET 7 (7.0.5) project I'm using the Dropbox Sign SDK (latest version 1.1.1).

When I call the SignatureRequestSendAsync (see code below) I receive the following error:

System.ArgumentException: The value cannot be null or empty. (Parameter 'mediaType')

var signingApi = new SignatureRequestApi(
    new Dropbox.Sign.Client.Configuration {
        Username = _configuration["DropboxSign:Key"]
    }
);

var newSigningRequest = new SignatureRequestSendRequest
{
    Title = "Document to sign",
    Message = "Please sign this document",
    Signers = listOfSigners,
    Files = listOfFiles,
    [...]
}

var signingResponse = await signingApi.SignatureRequestSendAsync(newSigningRequest);

As far as I can read here and here, this is due to a null reference conflict between .NET 7 and RestSharp prior to version 109. The Dropbox SDK reference RestSharp version 108.0.1.

Is there anything I can do myself to fix this until the error is fixed by the Dropbox team? I've tried downloading a newer version of RestSharp to my project, but that breaks the Dropbox SDK.

Upvotes: 0

Views: 976

Answers (1)

Aleacinom
Aleacinom

Reputation: 26

It looks like the NET team actually addressed the issue with null values being passed — it defaults them to text/plain, the way NET 6.0 used to handle them.

I'm running a test project on NET 7.0.7 with Dropbox Sign's RestSharp 108.0.1 dependency and have had no issues.

Upvotes: 0

Related Questions