Graph API SDK for .NET v6, C# Winforms - c#

I've just installed Visual Studio Community and wanted to have a play around with C# (.net 6 LTS) and the graph API. I've created a winform for this purpose.
I've looked at the documentation and can see i need to install the SDK via nuget, but when i'm searching the repository i can't seem to see it.
Am i doing something silly?

It would seem the default install didn't include the online nuget packages. so i spotted an image on another site with the package source. Add it and can now see the packages as expected.

Related

.Net MAUI - Github dependency

I have a blank .Net MAUI App that im planning to use, for simplicity sake, on Android only at the moment. I am trying to use a Github hosted service, namely Zettle by PayPal. Their documentation for using their Android SDK is here:
https://developer.zettle.com/docs/android-sdk/installation-and-configuration
"The Zettle Payment SDK for Android is available as packages from the GitHub package hosting service. To include the Android SDK in your project, you need to add a dependency to the package service, using your GitHub Token."
I have been trying to research how to include this in a MAUI Application, but I havent found anything relevant. Does anyone have any experience to point me in the right direction in getting a Github Package included in a MAUI or XAMARIN App?
I have looked at 'Microsoft Dependency Injection' but I dont believe this will work under these circumstances.

How to use pushsharp in existing c# project

There doesn't seem to be an installation guide in the PushSharp readme or the wiki link. I noticed that there's a NuGet installation for it, but I am not sure how it works. How would one incorporate it into an existing c# asp.NET project?
Edit:
It seems like the one from the NuGet package does not support dotNet core 1.1.
I found this that might support it: https://github.com/geeklearningio/PushSharp-Core
But I'm not sure how to incorporate this into my existing project.
Nevermind^ there's a NuGet package for the above, but it looks like its only support for dotnetcore2.0

Xamarin.Forms could not install package

When creating a new solution within Xamarian studio I get this error
Could not install package 'Xamarin.Forms 1.0.6186'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5,Profile=Profile78', 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.
Is there a certain version of .Net that Xamarian Forms requires for it to be included in the solution? I've tried searching in their documentation but I'm only seeing marketing and not real in depth documentation.
I had a similar issue using Visual Studio and I've found that the following combination in the PCL works:
.NET Framework 4.5
Windows Phone Silverlight 8
Xamarin.Android
Xamarin.iOS
You have created the wrong project type, you created a normal Windows app, and I assume you are targeting iOS/Android or Mac.
Create the project with the correct type and it should work correctly.
If you are using Xamarin Studio for Windows (without also having Visual Studio installed) you need to download the Portable Library Tools. See the Xamarin doc Introduction to Portable Class Libraries.
I had the same problem with my Xamarin project. The problem was, that in the portable Xamarin project Windows Phone Silverlight was set as target. The PCL project from which I created the nuget, didn't reference Silverlight as target. I don't need Silverlight, so uninstalling all nuget packages from my portable Xamarin project, removing silverlight as target and reinstalling the NuGet packages solved it.
I had similar issue using VS and I found solution here - http://forums.xamarin.com/discussion/29674/xamarin-forms-dll-cannot-be-installed
"It looks like your NuGet Package Manager needs to be upgraded. The Xamarin PCL Profiles are installed but NuGet is not recognising Xamarin.iOS as a target framework. You can update NuGet by selecting Tools - Extensions and Updates, then select the Updates tab, then select Visual Studio Gallery. Then update NuGet from there."
I have invested a lot of time trying all the solutions posted here, but none of them helped me... Here is the solution that worked for me (on Windows 10):
1.) Open your .csproj file
2.) Find the TargetFrameworkProfile entry
3.) This entry contains Profile78 for me, therefore I open the folder below
c:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETPortable/v4.5/Profile/Profile78/SupportedFrameworks
4.a) If the folder does not exist, then use one of the solutions posted here to install the PLC right on your PC
4.b) Unfortunately, ASP.NET and Xamarin don't like each other, therefore delete all ASP profiles from this folder. For me it was ASP.NET Core 5.0.xml. Obviously this will break your ASP.NET support in VS
5.) Restart Xamarin and have fun!
interesting reading about all that:
https://forums.xamarin.com/discussion/52846/cannot-create-new-xamarin-forms-project-pcl-in-xamarin-studio-win10-vs2015

Installing Twilio C# api with VS2008

I have successfully installed and tested twilio api with C# .Net framework 4.0 using VS2010. I referred to the link https://www.twilio.com/docs/csharp/install which has instructions to install with VS2010/12
Now I have another computer where I have to install twilio C# api with .net framework 3.5 and VS2008. How can I do that ?
I tried to copy the dlls and take reference but it didn't work.
Kindly let me know how can I install twilio api for C# with .net framework 3.5 and VS2008 ?
Twilio evangelist here.
You will likely need to manually download the NuGet package since there is no built in way in VS2008 to do it. There are a bunch of ways to do this:
NuGet Package Explorer
NuTake Chrome extension
NuGet support for Visual Studio 2008
Once you get the nupack file change its file extension to .zip, extract the contents and locate the folder that contains the .NET 3.5 version of the assemblies. Then add to your project.
Or you can always pull the source from Github.
Hope that helps.
Had to add SMS support to a legacy VS2008 app, and here's an easy way to do it.
Use VS2010 or later, create some dummy project, and then use Nuget Package to download Twilio. It will create a 'packages' folder inside your solution directory.
Use VS2008 to open your actual project.
Right click on references, select 'Browse' tab, and browse to the packages folder inside your dummy project you obtained in step one.
You need to add two references (one for Twilio, and one for RestSharp, which Twilio depends on). They are located in these two folders:
...\packages\Twilio.4.4.1\lib\3.5\Twilio.Api.dll
...\packages\RestSharp.105.2.2\lib\net35\RestSharp.dll
The versions I specify above are targetting .NET 3.5

Is there a Facebook SDK for .NET that works with 3.5?

When I first created my site, there were no .NET SDKs for Facebook so I wrote my own. It was pretty hacky, but it worked. Due to various Facebook changes, it's now broken beyond repair so I figured I'd use a real library. The one I found was the Facebook C# SDK.
However, it seems you can only download the source and compile it, and it seems it requires .NET 4.0 to compile. Also, looking through the code it seems to use .NET features such as System.Threading.Tasks. I'm still on .NET 3.5 and cannot upgrade at the moment. I'm wondering if there's a) a way to make this project work on 3.5, or b) another library that would be better in my case.
Facebook C# SDK supports .net 3.5sp1.
You can download using nuget.
If you are using VS 2008 where nuget package manager is not support, you can download using nuget command line tool. (http://nuget.codeplex.com/releases)
nuget install Facebook
For pre-release version you can download using the following command.
nuget install Facebook -pre
I have websites in .Net 3.5 using the latest code from the Facebook C# SDK. However, here's what I do. I use the "client" Facebook.dll to do all the stuff. Yeah, I don't get some of the wizbang session information, etc. But I do get full access to the API. I use javascript for authentication then AJAX the access token to the server.
I guess it depends on how committed to making the new SDK work with your codebase.
You could branch the code from Facebook C# SDK as you listed and replace all the task stuff with System.Threading.Threads, but that could result in a lot of work if there is extensive use of Tasks.
Or you could update your SDK to just address the areas you currently require until you can move to .NET 4. At least that way your project won't need reworking, just your internal library that your project is already referencing.

Categories

Resources