I have made a dll that wraps around some Google operations. With my first test drive it worked perfectly, but now in a real program, I get a weird assembly reference problem:
FileNotFoundException was unhandled
Could not load file or assembly 'Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Det går inte att hitta filen.
I have heard of System.Threading.Tasks (and am "using" it), but where does Microsoft.Threading.Tasks come in? The exception occurs at the last row of the snippet below.
Google.Apis.Admin.Directory.directory_v1.Data.Groups allGroupsResp = null;
var req = DirectoryService.Groups.List();
req.Domain = _settings.Domain;
allGroupsResp = req.Execute();
And there is no Microsoft.Threading.Tasks in the assembly list.
This is what worked for me:
Open the NuGet console via the Tools menu > NuGet Package Manager > Package Manager Console
From the console type in: update-package Microsoft.Bcl.Async -reinstall
After that, you may be prompted to re-start Visual Studio to finish uninstalling the package. Once you re-start, the package should be re-installed and everything should work.
Sounds like you're using the Google API .Net Client. I suggest using Nuget to install the assemblies as described on the linked page. However, if you download the source, the Microsoft.Threading.Task
assmeblies are included and so it seems the code your calling is trying to access those assemblies.
You could manually move that assembly into your directory but I'd usually opt for the Nuget
method unless you need to be using a particular build.
I expect you are using the "google-api-dotnet-client". Microsoft.Threading.Tasks is a dll used by this client according to google code: https://code.google.com/p/google-api-dotnet-client/source/browse/ThirdParty/Microsoft.Threading.Tasks.dll
You probably just have to move this file into your bin directory.
Just install Microsoft.Bcl.Async
nuget package!
(if you are using Google.Apis.Oauth2.v2
with UWP
app)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With