Closed GoogleCodeExporter closed 9 years ago
Step 2.1) install latest nuget with "Install-Package Google.Apis.YouTube.v3
-Pre"
Original comment by theonlys...@gmail.com
on 4 Feb 2014 at 8:04
Stacktrace:
System.AggregateException was unhandled.
HResult=-2146233088
Message=One or more errors occurred.
Source=mscorlib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at Google.Apis.Upload.ResumableUpload`1.Upload() in c:\code\google.com\google-api-dotnet-client\default\Tools\Google.Apis.Release\bin\Debug\output\default\Src\GoogleApis\Apis\[Media]\Upload\ResumableUpload.cs:line 351
at UploadTest.Program.<>c__DisplayClass2.<Main>b__1() in e:\Development\Repositories\YouTube Reloader\UploadTest\Program.cs:line 52
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Threading.Tasks.TaskCanceledException
HResult=-2146233029
Message=A task was canceled.
InnerException:
Original comment by theonlys...@gmail.com
on 5 Feb 2014 at 11:06
More data is available here -
http://stackoverflow.com/questions/21559550/youtube-api-upload-files-without-any
-error-c
Original comment by pele...@google.com
on 5 Feb 2014 at 9:07
Tried to run the same sample but eventually I got 401 - Unauthorized.
[ I tried to run it with NET 4.5 and got runtime error, solved that one ]
The reason the upload is canceled is based on error in Microsoft.Bcl.Async
package.
There is more information in
http://stackoverflow.com/questions/21057052/google-api-oauth2-c-sharp-asp-net-ap
p-crashes-could-not-load-file-or-assembl.
I just ran your code in my machine, and t didn't work as I expected. So, I
solved that one by copy the content of
"packages\Microsoft.Bcl.Async.1.0.16\lib\net40" into my bin folder.
I already opened an issue for the owners of the Bcl.Async package, and they
might solved this issue soon, but meantime you have a solution.
Original comment by pele...@google.com
on 6 Feb 2014 at 3:12
I tried 2 things, but they still result in the same error.
1) Change the Project to .NET 4.0 (and reinstall the nugets) that way
"Microsoft.Threading.Tasks.Extensions.Desktop.dll" will be in the bin folder
2) Use .NET 4.5 and simply copy the
"Microsoft.Threading.Tasks.Extensions.Desktop.dll" over to the bin folder
PS: The video actually shows up on YouTube, but it is "Processing" and never
actually uploaded.
Original comment by theonlys...@gmail.com
on 6 Feb 2014 at 11:38
Actually I think the "Microsoft.Threading.Tasks.Extensions.Desktop.dll" has
nothing to do with the upload failing. It is only once needed to open a new
browser for the authentication, as soon as the app is authorized you actually
don't need it anymore, the app will run just fine without that dll in the bin
folder.
Original comment by theonlys...@gmail.com
on 6 Feb 2014 at 11:45
I agree. I just wanted to write down the process I had
(Microsoft.Threading.Tasks.Extensions.Desktop.dll)
Can you attach the fiddler output for all the trafic?
Original comment by pele...@google.com
on 6 Feb 2014 at 1:08
Here you go.(I removed the first HTTP tunnel and oauth authentication for
security reasons, if you need it feel free to write me an email)
If you look at the PUT-Request: 10485760 Bytes have been sent (in the bodies),
the video is 11176345 Bytes big...
Edit: I actually can't upload it because "Project attachment quota exceeded." I
will send you the attachment via email.
Original comment by theonlys...@gmail.com
on 6 Feb 2014 at 3:44
see my answer in
http://stackoverflow.com/questions/21559550/youtube-api-upload-files-without-any
-error-c/21610550#21610550
I think I got it.
Let me know
Original comment by pele...@google.com
on 6 Feb 2014 at 6:02
It works now. Guess my internet is just to slow so the task times out.
Original comment by theonlys...@gmail.com
on 6 Feb 2014 at 6:20
Original comment by pele...@google.com
on 6 Feb 2014 at 6:38
Original issue reported on code.google.com by
theonlys...@gmail.com
on 4 Feb 2014 at 8:03