Can't run the upload sample of youtube data API v3 - c#

I'm getting started with the youtube API (and .net in general) and I get the error:
"could not load file or assembly Microsoft.Threading.Tasks.Extensions.Desktop"
I installed from NuGet the packages Google.Apis.Tasks.V1 and Google.Apis.Youtube.v3.
Both packages say they support .net 4.5
The sample code is this https://github.com/youtube/api-samples/blob/master/dotnet/UploadVideo.cs
Where do I get that assembly?

If your package manager installed all references, then it should be in Microsoft.Bcl.Async.1.0.16\lib\net40.
I used this code to test youtube API upload, used .net framework 4.0, and it worked. Try to see in this folder (or if you don't have newest Microsoft.Bcl.Async then in the one you have).

Related

VS update broke the microsoft.analytics.dll

I have a solution with two projects (C# and U-SQL) to run in the Azure Data Factory. I have referenced microsoft.analytics to use some analytics functions.
After the VS update to 15.9.14 on July 9, 2019 the c# project was not building giving the error that the assembly is missing but it was not missing. If I clicked to the error it go away and recognize the assembly. Then I try to build again and same error appears.
So I check the dll and the version was the same as before update but after I opened it with dotPeek I saw that the assembly target framework was changed to 4.7.2.
My project is on 4.5 because of the official azure data factory documentation says that we can run projects only up to framework 4.5 so I can't upgrade to 4.7 or above.
You can see the difference of those dll.
Assemblies location:
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Enterprise\Common7\IDE\PublicAssemblies
So to resolve the problem I froze those dll and added as external references to my project in order to compile and build it and it worked.
If I want to create a new U-SQL project I can only pick 4.7.2.
My question is, how I can run U-SQL projects and analytics assemblies on an framework that is still not supported in the azure data lake?
If the Data Lake now supports 4.7.2 why there is no documentation for it or at least something to let us know?
Is this an VS minor update with a bug?
So after some Microsoft tickets they don't know how to respond to this. They said to try run some methods that are only present in the 4.7.2 framework in the data lake.
So I tried those methods and the jobs didn't run for obvious reasons.
Conclusion:
VS migrated the U-SQL projects to 4.7.2 but we can't run custom c# code for this target framework in the Azure.
Data Lake Analytics runs only 4.5 as said in documentation.
For now our project will remain 4.5.

Azure Function Adding Reference to Sharepoint.dll Failing

I am getting an error when I attempt to add a reference to the Microsoft.Sharepoint.dll into my Azure function class. It keeps giving me the following error:
Package Sharepoint 15.0.0 is not compatible with net462 (.NetFramework, Version=v4.6.2). Package Sharepoint 15.0.0 supports microsoftsharepoint (Microsoft.SharePoint,version=v0.0).
Also the Microsoft.Sharepoint.Client.Runtime has a similar issue.
Given this I have followed other advice to switch the targeting framework to 4 and 4.5 but all of these seem to fail similarly. What is the supported framework for this and how can I add it into an azure function. Also I am dealing with an on-prem instance of sharepoint so I cannot connect via the online apis.
The Microsoft.Sharepoint.dll have no dependencies so, it it no matter with framework. I test in my site and could install it correctly.
You could try to use the Package Manager console in Visual Studio to install instead of the Manager Packages tool for the project.
And if you use Manage Nuget Packages, delete Nuget's cache from the packages' manager configuration.

Google Data .NET API Installer - Claims I need .NET 2.0

I recently downloaded the Google Data .NET API from this website to use in C#. When I downloaded and ran the most recent installer for the Google Data API, it claims I need to install .NET Framework v2.0. However, I already have .NET v4.0 installed. The installer won't let me continue without "installing" .NET, but I already have a more recent version installed. All the information I have found on this API points back to the webpage where I got my installer, so the page doesn't seem to be outdated. Do I need to downgrade and also install version 2.0?

Amazon AWSClientFactory does not exists

I created an empty .Net Core application and installed nuget packages for Both Amazon.Core and Amazon.S3.
Then I tried to use S3 to get an object but I'm stuck at the very first moment... Amazon.AWSClientFactory is nowhere to be found inside the assembly. Even with dotPeek I tried to search this factory method but I couldn't find it. Even the sample code from Amazon doesn't work.
Where I supposed to find this class ?
Amazon.Core and Amazon.S3 are part of the AWS SDK for .NET v3. Per the AWS SDK for .NET Version 3 Migration Guide:
Change: AWSClientFactory is removed
Description: Use service client constructors instead of the AWSClientFactory
Or in other words, use IAmazonS3 and AmazonS3Client found in the Amazon.S3 nuget package:
using (IAmazonS3 client = new AmazonS3Client())
{
// do stuff
}
Further Reading
AWS Documentation - Get an Object Using the AWS SDK for .NET
AWS Documentation - AmazonS3Client
Anthony is right. The AWSClientFactory is removed but, remember the NuGet packages are targeted or build for the specific platform.
You will still able to use the AWSClientFactory when you set the Target Framework to 4.5.2 and install the NuGet package and when you set the Target Framework 4.0 and install the NuGet Package you will not able to use AWSCLientFactory but, instead, you can use the AmazonS3Client and write a program to work with S3.
Perhaps, understanding the .net implementation support would clarify why you faced the issue. You need to understand "The higher the version, the more APIs are available to you." Here is the link that would help you to understand the same.

.Net Micro with Microsoft Azure

I'm trying to make a Netduino communicate with Azure. I've found several other projects and in their source code they use the package Microsoft.WindowsAzure like any other Azure project. In my project, though, it claims that the package name cannot be resolved.
I found somewhere that I had to go into Manage NuGet Packages and install it, but when I try, it halts the installation at JSON and rolls it all back.
This is the error message I get:
Adding 'Newtonsoft.Json 5.0.8' to Netduino.
Uninstalling 'Newtonsoft.Json 5.0.8'.
Successfully uninstalled 'Newtonsoft.Json 5.0.8'.
Install failed. Rolling back...
Could not install package 'Newtonsoft.Json 5.0.8'.
You are trying to install this package into a project that targets '.NETMicroFramework,Version=v4.2',
but the package does not contain any assembly references or content files that are compatible with that framework.
For more information, contact the package author.
What haven't I done? What am I doing wrong?
You can use NETMF.Json if you are running NETMF 4.2 or later
NETMF.Json on GitHub
I use it in my realtime pub/sub client for NetDuino here XSockets NetMF client
AFAIK Newtonsoft.Json is not compatible with .NET Microframework
"Supports .NET 2, .NET 3.5, .NET 4, Silverlight, Windows Phone and Windows 8" (from http://json.codeplex.com/ )
Infact you get this error:
You are trying to install this package into a project that targets '.NETMicroFramework,Version=v4.2',
but the package does not contain any assembly references or content files that are compatible with that framework.

Categories