ErAmySharma / google-api-dotnet-client

Automatically exported from code.google.com/p/google-api-dotnet-client
Apache License 2.0
0 stars 0 forks source link

Google Drive, 2013 Express C# WPF App, NuGet Microsoft.Threading.Tasks.Extension.Desktop error #426

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  Visual Studio 2013 Express, install latest Google Drive via NuGet
2.  Create WPF desktop application
3.  Reinstall all NuGet package via Update-Package, and with and without using 
-ignoreDependencies option

What is the expected output? What do you see instead?
Upon call of "await GoogleWebAuthorizationBroker.AuthorizeAsync(" I get an 
error "Could not load file or assembly 
Microsoft.Threading.Tasks.Extension.Desktop".

What version of the product are you using?
What is your operating system? Server 2008 R2
What is your IDE? Express 2013
What is the .NET framework version? 4.5

Please provide any additional information below.
I've tried adding the autogeneratebindings option to the project file, I've 
tried re-installing all NuGet packages (I already had referenced Json.Net), 
etc. but the project still won't compile.  I've upgraded from Visual Studio 
2012, and tried to downgrade to  .Net 4.0 but this isn't an option given my 
app's design.

I also can't compile the download code and tests with Visual Studio Express 
2013.

Also the Drive QuickStart example is obsolete.

I'm considering skipping the library altogether and wrapping my own calls 
against the REST endpoints given the heavy use of Tasks in the library and my 
application already is designed with it's own threading model.  I'd think most 
applications using the Drive SDK will also use other cloud or server based 
storage API's, some of which do not provide internal async/thread workers, so 
it's probably best to keep the library simple and push the handling of 
threads/tasks to the application developer.

Original issue reported on code.google.com by randall....@gmail.com on 8 Dec 2013 at 4:41

Attachments:

GoogleCodeExporter commented 9 years ago
Error in my write up project compiles with the NuGet libraries but gives a 
runtime error.

The download code with tests won't compile.

Original comment by randall....@gmail.com on 8 Dec 2013 at 4:44

GoogleCodeExporter commented 9 years ago
1. What is your target framework? 4.5 or 4?
2. Can you please add the content of your packages.config file?
3. If you start over again, and create a project in 4.5 then add 
Google.Apis.Drive.... reference, and then add your code. Are you still getting 
the runtime error?

Original comment by pele...@google.com on 8 Dec 2013 at 5:42

GoogleCodeExporter commented 9 years ago
1. What is your target framework? 4.5 or 4?
2. Can you please add the content of your packages.config file?
3. If you start over again, and create a project in 4.5 then add 
Google.Apis.Drive.... reference, and then add your code. Are you still getting 
the runtime error?

Original comment by pele...@google.com on 8 Dec 2013 at 5:42

GoogleCodeExporter commented 9 years ago
Target framework 4.5, from 
https://code.google.com/p/google-api-dotnet-client/wiki/Setup says I can use 
3.5 or higher

Packages.config

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Google.Apis" version="1.6.0-beta" targetFramework="net45" />
  <package id="Google.Apis.Auth" version="1.6.0.1-beta" targetFramework="net45" />
  <package id="Google.Apis.Drive.v2" version="1.6.0.107-beta" targetFramework="net45" />
  <package id="log4net" version="2.0.3" targetFramework="net45" />
  <package id="Microsoft.Bcl" version="1.0.19" targetFramework="net45" />
  <package id="Microsoft.Bcl.Async" version="1.0.165" targetFramework="net45" />
  <package id="Microsoft.Bcl.Build" version="1.0.13" targetFramework="net45" />
  <package id="Microsoft.Net.Http" version="2.1.10" targetFramework="net45" />
  <package id="Newtonsoft.Json" version="5.0.8" targetFramework="net45" />
  <package id="System.Net.FtpClient" version="1.0.5025.13390" targetFramework="net45" />
  <package id="Zlib.Portable" version="1.9.2" targetFramework="net45" />
</packages>

I'll have to get back to you on creating a new project.

Original comment by randall....@gmail.com on 8 Dec 2013 at 6:33

GoogleCodeExporter commented 9 years ago
I dowload the samples files

http://samples.google-api-dotnet-client.googlecode.com/hg/Drive.Sample/README.ht
ml

Open the solution in VS 2012, check the options for NuGet to auto download 
packages, then compile.  Some errors on other projects but the Drive sample 
works - opens the browser and prompts to accept my application access.  The 
Drive project targets .Net 4.

If I change to .Net 4.5, re-install all packages, then re-build, the sample 
project throws the same errors as my project.

So it seems the Drive packages do not work with .Net 4.5.

Original comment by randall....@gmail.com on 9 Dec 2013 at 1:07

GoogleCodeExporter commented 9 years ago
Issue 445 has been merged into this issue.

Original comment by pele...@google.com on 3 Feb 2014 at 3:12

GoogleCodeExporter commented 9 years ago
You can find a solution here - 
http://stackoverflow.com/questions/21057052/asp-net-app-crashes-could-not-load-f
ile-or-assembly-microsoft-threading-tasks/21343949#21343949

I'm closing this issue, feel free to reopen if you find something is missing.

Original comment by pele...@google.com on 21 Feb 2014 at 11:23

GoogleCodeExporter commented 9 years ago
You can find a solution here - 
http://stackoverflow.com/questions/21057052/asp-net-app-crashes-could-not-load-f
ile-or-assembly-microsoft-threading-tasks/21343949#21343949

I'm closing this issue, feel free to reopen if you find something is missing.

Original comment by pele...@google.com on 21 Feb 2014 at 11:23