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.
Related
I need to get application display name by service principal id in UWP C# project. I found sample Getting started on managing service principals using C#, but this sample based on Microsoft.Azure.Management.Fluent, Microsoft.Azure.Management.Graph.RBAC.Fluent and Microsoft.Azure.Management.ResourceManager.Fluent, which are deprecated. Any other ways to get appId (except http request) I don't know.
Before installing the NuGet packages, use the latest .Net framework in order to resolve few of the deprecated issues.
*For these deprecated packages
Microsoft.Azure.Management.Fluent
Microsoft.Azure.Management.Graph.RBAC.Fluent
Microsoft.Azure.Management.ResourceManager.Fluent
Microsoft has provided alternate packages and the dependencies for the packages.
Use the below highlighted alternate packages
For Microsoft.Azure.Management.Fluent and Microsoft.Azure.Management.ResourceManager.Fluent use Azure.ResourceManager
Azure.ResourceManager
Azure.ResourceManager
And the below package is not deprecated Microsoft.Azure.Management.Graph.RBAC.Fluent
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.
I was working with Unity and Hololens and tried to establish connection to Azure Iot Hub via MQTT protocol. Microsoft provides a tutorial for getting started with Azure IoT Hub in C#, but unfortunately, I encountered a problem with the tutorial:
In the picture above, I have selected Microsoft.Azure.Device NuGet package for installation. I have tried version 1.0.0 and also the latest one available, 1.2.4. The projects were automatically generated by Unity and that is probably the reason, why I do encounter this problem. Which problem? After I try to install the selected NuGet, I encounter the following error:
Could not install package 'Microsoft.Azure.Devices 1.2.4'. You are
trying to install this package into a project that targets
'.NETFramework,Version=v3.5,Profile=Unity Full v3.5', 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.
I was like, "Hmm, I must have wrong .NET framework version. I wonder if I can change that..." I tried to go to project properties like this
Microsoft advises changing .NET framework from Properties context menu item:
https://technet.microsoft.com/fi-fi/library/bb772098(v=vs.90).aspx (4.24.2017)
https://msdn.microsoft.com/en-us/library/bb398202(v=vs.100).aspx (4.24.2017)
However, this feature must be blocked by something, because the view that is supposed to open flashes white and disappears immediately. I suppose Unity doesn't like people tinkering with project properties, but what else can I do? Incompatible .NET framework issue needs to be resolved, so that the NuGet package can be installed, but how do I do that?
In short, how to install Microsoft.Azure.Devices NuGet package for Unity?
Sorry, this isn't possible due Unity's restriction to .net 3.5.
To be exactly, they use a custom version of mono-2.
You could try the new (experimental) .net 4.6 settings in Unity 5.6.
https://forum.unity3d.com/threads/upgraded-mono-net-in-editor-on-5-5-0b4.433541/
I just got a new computer at work and started to migrate my projects to VS2013. Now the problem is that with Azure SDK 2.4 the DLL Microsoft.WindowsAzure.StorageClient.dll is not included in it anymore.
I found this this post on the matter, were it was told that they were kept out of the 2.4 in order to keep it lighter and you need to add them in using NuGet.
OK, that's fair enough, but I've tried for hours to find the correct package with no luck. Anyone knows with package holds that DLL?
You're trying to add Microsoft.WindowsAzure.StorageClient.dll which is really-really old version of Storage Client library (thus not recommended). But if you're trying to get this DLL, try this link: http://www.nuget.org/packages/WindowsAzure.Storage/1.7.0.
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).