SignalR .net core client in .NET framework 4 apllication - asp.net-core

I have 2 applications:
NetCore 2.2 web-application
.Net Framework 4 web-application (owin, nancy-framework). For some reasons I cant upgrade target net framework version in this
application.
There is a requirement to provide two-way connection. In other words, I want to send commands from 1st app to 2nd app.
More about the situation:
With current network organization I can make request from 2-app to 1-app, it works successfully.
But I can't make request from 1-app to 2-app (host of 2nd app is not pingable from 1st app). I was hoping to solve the problem with SignalR library, but it has platform-depend limitations (signalR Core client library in old applications, Microsoft.AspNetCore.SignalR.Client package).
How can i solve this problem? Maybe I have some alternatives?

Related

How to version SignalR websockets?

We are building a web application in Asp.Net Core that will be used to centralize and communicate with a lot of instances of a custom servers(which is in C# too).
We need versionning, because updating those custom servers is really time consuming and can be a blocker for people to install newer version of the web app.
For the HTTP part, it's "easy", we have to use the Asp.Net Core versionning and a given version of the custom server will know how to communicate with a given version of the web app.
But we have a SignalR service that is used to provide notification to the custom servers from the web app, and request some data, some actions, ... Is there a way to provide several version of the client interface for this? And having the signalR server able to transform the message to each version?
Thank you

.NET Core Hosting Bundle

As far as I understood the Docs, the .NET Core Hosting Bundle installs the .NET Core Runtime, .NET Core Library and the ASP.NET Core Module.
It seems that there's a Bundle for every version of the .NET Core Runtime (2.0.6, 2.0.7, ...).
If I have a self contained deployment of my app, I still need the ASP.NET Core Module. However I don't see that the Module can be downloaded separately without the full bundle. Is there a place where I can download it ?
If not:
What's the point of having a self contained application, if I still need to install the whole .net core sdk/runtime bundle on my IIS Server?
There is no official download of the ASP.NET Core Module for IIS ("ANCM"), though it can be installed by calling the hosting bundle installer with OPT_INSTALL_LTS_REDIST=0 OPT_INSTALL_FTS_REDIST=0 as arguments (at least for 1.0-2.0 installs).
What's the point of having a self contained application, if I still
need to install the whole .net core sdk/runtime bundle on my IIS
Server?
Apart from the installer being able to install only ANCM, do not forget that IIS is not the only hosting option for ASP.NET Core Applications. People may still opt to host it on linux or as a Windows Service. Either being exposed to the public Internet (which is supported from 2.0+) or behind NGINX/Apache/…
It is also very useful to deploy preview, daily or custom builds of any component inside .NET Core / ASP.NET Core if needed.
Check the docs on this topic.
The ASP.NET Core Module is a fork of HttpPlatformHandler which was modified to work with ASP.NET Core's new system and was previously used to host ASP.NET Applications. related GitHub issue
IIS needs it in order to start up your ASP.NET Core application when the first request arrives and to route requests to the ASP.NET Core application.
With .NET Core (and hence ASP.NET Core), ASP.NET Core comes with its own http server (previously this was only possible with Http.sys aka WebListener self-hosting, i.e. commonly used for WCF services). It also redirects a couple of headers to the application, since IIS with ASP.NET Core only acts as reverse proxy.
In other words, ASP.NET Core is hosted outside the IIS process, and ASP.NET Core Module is there to communicate with it and starts the outside process if not already. This also means, that ASP.NET Core applications hosted in IIS are subject to IIS lifetime cycle (i.e. IIS may and will stop your applications when idle - This doesn't happen when you self-host your application or use something like nginx as reverse proxy).
With ASP.NET Core 2.1 preview1 it will also be possible to host ASP.NET Core application in the IIS process (w3wp.exe) for a improve request throughput. For more information on this, read ASP.NET Core 2.1.0-preview1: Improvements to IIS hosting

Service Fabric Instance's endpoint is not assigned IP address

I created simple dummy service which I have deployed into my testing SF cluster, but when I check the deployed application/service in SF Explorer and its instances all of them does not have assigned Endpoint's URL. Instead, there is:
(none) http://[::]:8322
I spent a half day trying to find a solution but I am not sure where is the problem.
The Service is Stateless service which uses ASP.NET Core 2.0 and Kestrel WebListener (it is basically slightly modified the template Service generated by Visual Studio when creating new ASP.NET Core Stateless service).
Make sure you're using version 2.7.198 (or greater for all you future readers) of the Service Fabric NuGet packages. This is the version that officially begins to support ASP.NET Core 2.0, which handles issues like this.

Does ASP.NET Core on .NET Core follow the console app model, or the IIS hosting model?

Currently I maintain an application that runs as a Windows service, reads messages from a message queue server, processes them and puts the result back into the message queue server. But it also contains a health monitoring component that is accessible through a web API.
It is implemented as a console app that uses Katana to self-host the health monitoring sub-system.
I'm now trying to figure out if we can move this to .NET Core and ASP.NET Core once they RTM. I know the Windows Service part cannot be ported, but I could also run the console app as a detached Docker container to basically achieve the same thing, in terms of main functionality.
But how will the health monitoring work? From what I can see the Katana project has been updated to ASP.NET 5 (which I guess is ASP.NET Core 1 before the big rename), but it does not run on the .NET Core CLR. Katana will require the full CLR. So that means Katana is out.
Does this mean that the way we build our app is impossible with .NET Core? Or does hosting the app through Kestrel not rule out the possibility of running code before the first request? With IIS the app does not live until the first request (unless you use the auto-start, but it's more of a speed-optimisation than have the app behave like an "allways-running-app") and generally the app is request-based and not continually running. Background threads in a IIS hosted app are a really bad idea.
Is this the same with Kestrel? Or will DNX start your app and keep it running until it's shutdown, much like a console app, so we can run all the background threads we want?
It follows the console app model. Katana is actually more the spiritual predecessor to kestrel. It is invoked for normal ASP.NET Core projects from the Main method with a normal method call. There are countless tutorials how to setup a server in RC1 (see Startup.cs Main method) and some for the upcoming RC2 (there is a builder for it). That would allow you to do both, your app code and your web api based monitoring, in a console app. Kestrel and DNX are not at all an application server like IIS. Kestrel is a plain HTTP server library and nothing more. You start it up and it listens from that moment on.
Nevertheless, you have to adjust your WebApi 2 and Katana based application to the new ASP.NET Core interfaces and middleware concept. But that should be easy compared to your message queuing adaption.

When I publish a WCF rest service in IIS the services do not work?

Im using WCF REST 4.0 meaning to say their is no .svc file.. So I have 3 different service classes in one service WCF Rest Application project. And I registered all these services in the Global.asax
What im trying to do is that I have a set of Business Functions from a lower framework e.g: .NET 1.0/2.0 where in i use datasets and not call basic add/update/delete entity function unlike in the newer releases. So I wanted to ask if this type of match would work in .Net 4.0 or is their any other reason for this?
Thank you
If your services work in Web Development server than they have to work in IIS. What version of IIS do you use? Remember that extensionless URLs are only supported in IIS 7.x. If you want to use them in older version you have to modify IIS configuration (check this thread). Also make sure that your IIS has properly registred .NET 4.0 and all realted ISAPI. If you installed .NET 4.0 after IIS it is best to use aspnet_regiis.exe from .NET 4.0 folder.