How to use pushsharp in existing c# project - c#

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

Related

Graph API SDK for .NET v6, C# Winforms

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.

Is Microsoft.CodeAnalysis.CSharp.CodeStyle still needed for a .NET 6 project?

I need to migrate a .NET Core 3.1 C# project to .NET 6. The .NET Core 3.1 project uses the analyzers Microsoft.CodeAnalysis.NetAnalyzers and Microsoft.CodeAnalysis.CSharp.CodeStyle as NuGet packages.
For Microsoft.CodeAnalysis.NetAnalyzers Microsoft clearly states that it is not needed as a NuGet package anymore. https://github.com/dotnet/roslyn-analyzers#microsoftcodeanalysisnetanalyzers:
You do not need to manually install this NuGet package [Microsoft.CodeAnalysis.NetAnalyzers] to your project if you are using .NET5 SDK or later. These analyzers are enabled by default for projects targeting .NET5 or later.
What's not so clear to me is whether the Microsoft.CodeAnalysis.CSharp.CodeStyle NuGet package can also be abandoned. Some things I read and manual tests suggest that adding <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> to the project file is sufficient. However, I found no specific confirmation for this.
Can someone confirm or correct and ideally shed some light on the relationship between Microsoft.CodeAnalysis.CSharp.CodeStyle and <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>?

Issue: Referring .Net Standard 2.1 project in .Net Core 3.1

My main project is in .net standard 2.1
my test project is in .net core 3.1
when ever i'm trying to build the solution I'm getting the below error
NU1201: Project xxx is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Project yyy supports: netstandard2.1 (.NETStandard,Version=v2.1)
Can some one help me in resolving this issue
We got this error too. The reason for this is that we use our own nuget server (which was proget 4.x). Each time we need a nuget we download it from nuget.org and add it to our own nuget server. The Microsoft.IdentityModel.Protocols.OpenIdConnect 5.5.0 nuget is a signed nuget however. Out nuget server didn't support this and it complained when we added the nuget. However, the nuget did get added - only it was not signed anymore and did not contain the dll's (which is really weird). I know this sounds bizar but this is exactly what happened. We temporarily solved this by adding the official nuget feed next to our own private feed while building (as first choice). That solved our problem. I'm just posting this in th eunlikely event you have the same issue.

How can I programmatically find a DLL restored by Nuget?

After a user does a dotnet add package <SomePackage>, the DLL will be installed to a path similar to:
C:\Users\USER\.nuget\packages\SomePackage\1.0.2\lib\netstandard2.0\SomePackage.dll
How can I find this path programmatically? I see there's some information in the obj/project.assets.json that I could parse, and also an interesting DependencyContextJsonReader class under the dotnet github organization.
However, there's no documentation or discussions about this that I can find, and I'm not sure if that's because I'm taking the wrong approach.
Some background:
I'm writing a tool that can scaffold C# projects. It uses a combination of the dotnet command line tools, and the Roslyn Workspace APIs to interact with the generated project. I'd now like to allow the user to install Nuget packages into this generated solution. I invoke dotnet add package SomePackage which works fine, and now I'd like to add the DLL to the Roslyn Project object using the AddReferences API, which requires the actual DLL.
I found a way to do this using the nuget client libraries.
Essentially, rather than shelling out to the dotnet add package command, I can use the NuGet client libraries directly from my application to install packages. I then have access to the full path via the PackagePathResolver.GetInstalledPath method.
Martin Björkström's post, Revisiting the NuGet v3 Libraries, goes into much more detail, and a fully working code sample from Martin is available in this gist.

Using SignalR on an asp.net Core app that targets the full .NET Framework

I have an existing ASP.net Core app that targets the full 4.6.1 .NET Framework instead of the .NETCore framework.
I need to know: is there ANY way to use SignalR on such an app? Reading around the net I found some people claimning to have fount workarounds, but I cannot find any details on exactly HOW to do it.
Any info on this subject is appreciated.
Well, after a lot of searching I found a sample project that implements this. You can find it here:
https://github.com/jkells/signalr2-netcore-websockets-sample
I implemented their same solution on my project and it works! Read the info on the github Readme carefully: you have to add the repository they mention to your nuget sources in visual studio or packages won't restore correctly.

Categories

Resources