Web API targeting .Net Framework vs .Net Core - .net-core

Is message pipe line and other constructs same for Web API that targets .Net Core or .Net framework? Can we use ActionFilters, DelagatingHandlers and other concepts while developing .Net Core based Web API?

For .NET Core, you want use the ASP.NET Core MVC project template. Note, .NET Core MVC and Web API were merged together.
You can read more about the Middleware here:
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/middleware/?view=aspnetcore-2.1

Related

How can I tell exactly what type of .Net project I've created and what DevOps pipeline I should use to build it?

I am using Azure DevOps with Azure Git and I believe I've created an ASP.Net Core application (.NET 5.0) that is my web API (Project/Solution A).
I've created a separate solution/project/branch for a MSTest project of unit tests that target the other application (web API) to verify the endpoints are all working (Project/Solution B)
I'm trying to create a pipeline to build Project B, so that I can link the test cases, but when I go to choose the pipeline configuration, I see ASP.NET Core (.NET Framework) and ASP.NET Core.
I thought ASP.NET Core used .NET Core, so how can it be both ASP.NET Core and (.NET Framework) at the same time?
What is the proper way to describe what my project is targeting? ".NET 5.0", ".NET Core", "ASP.NET Core 5.0", "ASP.NET Core", etc?
I thought ASP.NET Core used .NET Core, so how can it be both ASP.NET Core and (.NET Framework) at the same time?
Use the ASP.NET Core template. That because the template ASP.NET Core (.NET Framework) target for the full .NET Framework:
What is the proper way to describe what my project is targeting? ".NET
5.0", ".NET Core", "ASP.NET Core 5.0", "ASP.NET Core", etc?
Personally, the ASP.NET Core 5.0 should be the proper way to describe your project is targeting. That because we could create the Console application with .NET 5.0 or a ASP.NET Core 2.0 project. So, ASP.NET Core 5.0 can accurately describe your project type and target's .net core version.

NET Core library as a reference in the .NET Framework project

I have an application targeting .NET Framework and I'm using Signalr working
but now I need Signalr working with mobile flutter they specify need URL Signalr but .net framework cannot provide URl Signalr for flutter only .net core can provide, So how could I do?

.Net Standard class library with WPF application and .NET Core Web app

I have,
Existing class library written with .Net Framework 4.5.2
Exiting WPF application written with .Net Framework 4.5.2
WPF application using class library.
Now, I would like to create asp.net Core web app with dotnetcore 2.1 and want to reference the class library.
Do I need to,
Convert class library with .Net Standard?
Which version of .Net Standard so that I should be able to refer to my WPF application (with .Net Framework 4.5.2) which we can't convert to .Net Core UI app?
Yes, you have to convert you libriary to .NET Standard in order to reference it from both Framework and .Net Core apps
You would need to use .NET Standard version 1.2 or lower in order to support .NET Framework 4.5.2
See the documentation for details: https://learn.microsoft.com/en-us/dotnet/standard/net-standard#net-implementation-support

Angular 4 server side rendering in Asp.Net MVC 5 Framework (non Core)

I'm trying to set up a project in Asp.Net 4.5.2 (VS2017) with Angular 4.
All examples seem to use Asp.Net Core, but we're trying not to jump into .NET Core just yet, if possible.
We would like to have server side rendering though, samples seem to use this asp-prerender-module attribute from "Microsoft ASP.NET Core JavaScript Services".
Is it possible to render angular 4 server side with MVC 5?
Officially there is no Asp.Net Framework (non Core) support.
As stated in https://universal.angular.io/overview/:
In addition to node.js, however, Angular Universal has ASP.NET Core
support. In the near future we hope to add support for Java, PHP and
Python
EDIT: "Microsoft ASP.NET Core JavaScript Services" only supports ASP.NET Core which means the site needs to deployed ASP.NET Core style. But this all can run in .NET 4.5.2 so you can still reference your good old .NET Framework libraries in your project.

Restful service with .net

Microsoft is encouraging developers to use asp.net web api for creating Restful services. I have done some googling
http://www.matlus.com/asp-net-web-api-with-webforms/
it seems to me that i can use it with .net 4.5 but not with 4.0. In .net 4.0 what are my options for creating Restful service. is it only wcf web api or something else that should be used?
You can create asp.net web api service without installing .net 4.5, you only need to install asp.net mvc 4 for VS2010 and normally use for .net 4.0. Alternative, you can use WCF service or asp.net mvc controllers for REST architecture, see this example with asp.net mvc
A small mistake of yours, there is no WCF Web Api anymore. That was the original name, then it was renamed ASP.NET Web Api.
You can use it with .NET 4.0. Just install ASP.NET MVC 4 and you get Web Api. But it's still in Beta...

Resources