I am building an application in .net core 2.0 and we have a requirement to subscribe and publish messages to RabbitMQ. Could find NuGet package which uses standard .net library[a hell lot of DLLs get added]. however, I am looking for pure .net core application which can be hosted in Linux as well.
Does anyone has implemented the same stuff?
Related
Is this possible ?
I made a small demo app, and when using .NetFramework as a server, and a .NetFramework asa client everything works fine...
Then, I was lucky enough to find before even trying,that the "AspNet.SignalR" packages (used for SignalR in my WCF .NetFramework service(server)) is not compatible with "AspNetCore.SignalR" used by my Blazor WASM project...
Now, my question is, how can I get to a "middle-ground" in this situation ?
I cannot migrate the .NetFramework app to .NET unfortunately.
Is there any chance i can consume the SignalR from .NET, when having a .NET Framework (v4.7) as a SignalR server?
I am trying to develop a very simple WCF application. The WCF server will be in a windows 10 computer and I would like to consume this service with a WPF application in a windows 10 computer and also I would like to have another application for android, using Xamarin.
In visual studio I see that I can create a Net Core library and also I see that Net core is compatible with WCF, I can see in this web.
Also I know that Net Core can be run in Windows, Linux and Mac.
So I am wondering if I could develop a Net core Library to develop the client so I could use it in my WPF and Android applications.
My doubt it is when I add a reference in my WPF application to the net Core library project, I see a yellow triangle, a warning, so I guess that WPF can't use the Net Core library.
So I was thinking that perhaps, for the WCF layer, I would have to create a Net Standard project that can be use by the WPF application and the Android application. But I would like to know if this is the unique way or there are some way that a WPF application can use a Net Core library without needed to use a middle project like Net Standard.
For the server, I was thinking to use Net Core too, because this project will not be referenced by any other project and Net Core can be used in windows.
Well, you should create a .Net Standard Class Library (So, not .Net Core), put in your WCF clientside code in there and you can reference it from a .Net Core or .Net Full project. a .Net Standard Class Library will give you most flexibility so it is the recommended project type for shared libraries.
But according to the docs, see last line you will need to use .Net Full for the server side:
WCF service applications should still be created with the full .NET Framework version.
But I would like to know if this is the unique way or there are some way that a WPF application can use a Net Core library without needed to use a middle project like Net Standard.
No. A WPF application targeting .NET Framework cannot reference a .NET Core project.
.NET Core 3, which is currently in preview, does however support WPF which means that you can reference a .NET Core project from a WPF application that targets .NET Core. But an application targeting .NET Framework cannot reference a library that targets .NET Core and vice versa.
You should prefer to target .NET Standard in your class library projects since these can then be consumed from applications targeting either .NET Framework or .NET Core.
WPF / Winforms applications are not supported on .Net Core platform yet.
Present:
By yet, I mean .Net core 2.x versions.
So, if your application is NOT based on 2.x standard of .net core, you will NOT be able to reference the .net core assembly.
Future:
.Net core 3 preview is available and Winforms / WPF applications are now available on the .Net core platform.
Hope this helps.
I want to create an ASP.NET Core MVC 2 web application which I could host on Linux and Windows (i.e. in both OS). So, I am to use .Net Core. But when I create new ASP.NET Core MVC 2 web application I see two comboboxes. At first I am to select either .NET Frmework or .NET Core. The second combobox contains only ASP.NET Core 2.0.
Q1:
Does it mean that ASP.NET Core 2.0 is technology which is implemented in both frameworks (.Net Framework and .NET Core)?
It is impossible to switch .Net Framework to .NET Core for such project later. I could use .NET Core but here Microsoft writes that I am to use .NET Framework if I want to use Windows Service...
I want to use Nginx for Windows on my computer (instead of IIS) - it is interesting for me to try it. :) Here Microsoft describes how to host ASP.NET Core web application on Linux with NGinx. At the article the Create the service file topic exists. But it is for Linux... So, if I want to host my ASP.NET Core MVC 2 web application on Nginx in Windows then I am forced to use Windows Services (look here). But in the Host an ASP.NET Core app in a Windows Service article Microsoft writes that I am to use .NET Framework instead of .NET Core...
Q2
Does it mean that I can't the same project use for build my web application for Linux and Windows (for Windows Service)? Does it mean that for my goal I am to create two project: for .NET Framework and for .NET Core and to share the code sources for both projects?
Q1
Does it mean that ASP.NET Core 2.0 is technology which is implemented
in both frameworks (.Net Framework and .NET Core)?
.NET Core 2.0 and .NET Framework 4.6.1 are both implementations of .NET Standard 2.0. What this means is that they can both do the same things, and work mostly the same, but .NET Framework contains some Windows only libraries (System libraries such as Windows Forms) that mean it can only run on Windows. .Net Core programs can run on Windows, Linux and MacOS.
It is impossible to switch .Net Framework to .NET Core for such
project later. I could use .NET Core but here Microsoft writes that I
am to use .NET Framework if I want to use Windows Service...
While this is technically possible, you really want to avoid it. It's a huge headache, and usually breaks a lot of your code, with missing dependancies etc.
I want to use Nginx for Windows on my computer (instead of IIS) - it
is interesting for me to try it. :) Here Microsoft describes how to
host ASP.NET Core web application on Linux with NGinx. At the article
the Create the service file topic exists. But it is for Linux... So,
if I want to host my ASP.NET Core MVC 2 web application on Nginx in
Windows then I am forced to use Windows Services (look here). But in
the Host an ASP.NET Core app in a Windows Service article Microsoft
writes that I am to use .NET Framework instead of .NET Core...
I haven't personally used NGinx for Windows, but it looks as though they want you to set the target version for your NET Core app to NET Framework for the purposes of their example. Since .NET Core doesn't have the references to System specific libraries, you can easily change target to NET Framework. This doesn't make it a NET Framework project, it just changes the runtime against which Visual Studio will build it.
Q2
Does it mean that I can't the same project use for build my web
application for Linux and Windows (for Windows Service)? Does it mean
that for my goal I am to create two project: for .NET Framework and
for .NET Core and to share the code sources for both projects?
You can absolutely use the same application for both platforms, however it'll be a little different to how you're used to it. Since .NET Core is platform agnostic, Visual Studio won't generate an exe for you, it'll just generate dll files. You then use the dotnet command at the command line to start the program, e.g.
dotnet helloWorld.dll
This is how you run the program on any OS, provided you have the .NET Core runtime installed (There are plenty of guides on how to do this online).
Hope I've answered everything clearly :)
What is the difference between ASP.NET Core Web (.NET Core) vs ASP.NET Core Web (.NET Framework)?
and does .NET Framework provide similar performance as to .NET Core?
This can be confusing at first, but it's important to remember: at the end of the day, "ASP.NET Core" is just a bunch of NuGet packages that can be installed in your project.
ASP.NET Core on .NET Core is cross-platform ASP.NET Core. It can run on Windows, Mac, and Linux (including Docker). The server doesn't need .NET Core installed - the dependencies can be bundled with the application.
ASP.NET Core on .NET Framework is ASP.NET Core on the "full" or "desktop" .NET Framework (e.g. .NET Framework 4.6.2). These applications can only run on Windows, but everything else about ASP.NET Core behaves the same way.
According to the benchmarks you linked, both will have higher performance than ASP.NET 4.6, although .NET Core is currently the highest:
ASP.NET 4.6: <50k req/sec
ASP.NET Core (CLR): 400k req/sec
ASP.NET Core (.NET Core, Linux): 900k req/sec
ASP.NET Core (.NET Core, Windows): >1.1m req/sec
However, these benchmarks are slightly older (February 2016) and reflect pre-RTM code. I wouldn't be surprised if they've improved since then.
ASP.NET Core with .NetCore is a cross-platform (it can run on Windows, Linux or other platforms), high-performance, open-source framework for building modern, cloud-based, Internet-connected applications. It has ability to host on IIS, Nginx, Apache, Docker, or self-host in your own process.
ASP.NET Core ships entirely as NuGet packages. This allows you to optimize your app to include only the necessary NuGet packages. In fact, ASP.NET Core 2.x apps targeting .NET Core only require a single NuGet package. The benefits of a smaller app surface area include tighter security, reduced servicing, and improved performance.
It is not required to install .Net framework to run asp.net core with .net core application.
An ASP.NET Core application with .net core is a console app that creates a web server in its Main method. It uses Kestrel web server to run the application.
We can also use editors such Visual Studio Code, Atom to run the application.
It doesn't support Aspx, WPF, WCF and WebServices as if now.
It supports inbuilt dependency injection.
Uses coreclr which is the runtime in asp.net core with .net core.
Asp.Core with .Net framework .Net framework on the other hand started much before 2005 and it kept on adding new features making it a bit complex framework and heavier. It is not cross platform.
It supports Aspx, WPF, WCF and WebServices
.Net Framework excecution plan
.Net core exceution plan
ASP.NET CORE using .NET Core - all dependencies are self-contained, can use most nuget packages, cant use windows specific packages, can execute on windows, linux, Mac
ASP.NET CORE using .NET Framework - most dependencies are self-contained, only executes on windows, will have access to windows specific nuget packages, needs the .net framework version which is targeted installed on the machine
I want to add SignalR to my Windows service, written in C#, targetting .NET 4.0. The Microsoft.Owin.* packages appear to require .NET 4.5.
I'd also like to include NancyFX in the same process, for other reasons.
What's the best way to self-host SignalR?
I installed the signalR package (v. 1.1.2) using .net 4.0. Work as a charm. I cannot use 4.5 as I am still at VS2010.
I use it with a standard web project with a WebService handling the communication.
The only Microsoft OWIN package that requires 4.5 is owinhost.exe (used to be katana.exe), you can still use normal http listener (Microsoft.Owin.Host.HttpListener) to self host just fine.
If you install the packages as listed at https://github.com/SignalR/SignalR/wiki/Self-host they should work just fine under .NET 4.0. It's worth remembering that you can always use the package manager console to explicitly install older versions of packages if you need to - although for SignalR at the time of writing there is no need to do this.