Itay R
Itay R

Reputation: 31

Parameter name: Value cannot be null. Parameter name: baseUri when Uploading in Google drive V2 in C# .NET

I am trying to use google Drive API V2 to upload a file. My code is :

cStream = File.Open(strDOCFile, FileMode.Open);
var cUploadCommand = service.Files.Insert(new Google.Apis.Drive.v2.Data.File(), cStream, strUploadedMimeType);
var cResult = cUploadCommand.Upload();
cStream.Close();

But I'm getting the error after I perform the command "cUploadCommand.Upload()" in the cResult.Exception parameter, and the result is returned instantly:

Value cannot be null. Parameter name: baseUri

what the hell?

Upvotes: 0

Views: 424

Answers (1)

Itay R
Itay R

Reputation: 31

Solution: After battling for two hours with this error, It seems like the "Microsoft.Threading.Tasks" and "Microsoft.Threading.Tasks.Extensions" was not copied correctly to my binary folder. The required files are :

Microsoft.Threading.Tasks.dll
Microsoft.Threading.Tasks.Extensions.Desktop.dll
Microsoft.Threading.Tasks.Extensions.Desktop.xml
Microsoft.Threading.Tasks.Extensions.dll
Microsoft.Threading.Tasks.Extensions.xml
Microsoft.Threading.Tasks.xml

Once I had these files in my binary folder, the error disappeared! it seems like this is part of the library called "microsoft.bcl.async"

Upvotes: 1

Related Questions