There seems to be little documentation on the new WebAssembly ASP.NET Core hosted model. I realise that Blazer WebAssembly model is in preview until May 2020, however, once the latest preview template is installed in Visual Studio 2019, there is the option to use ASP.NET Core hosted.
From what I can gather, this model appears to be a hybrid between the Blazor Server App and the Blazor WebAssembly App hosting models in that in addition to using the client to render in WebAssembly, also employs server technology, e.g. SignalR.
What would be the benefits of using this hosting model?
What would be the benefits of using this hosting model?
In the hosted model, the server will:
serve the client (wasm) Blazor application
typically provide APIs that will be consumed by the client application
In the hosted model, you do not need SignalR to get the Blazor app working
Related
I have project that i want to build web app and mobile app using NET CORE
after research i just want to confirm the architecture=>> Blazor client side + asp core server side + NET MAUI for mobile.
i can build with these three projects in the same solution an apllication interact such as reading and writing information from and to the Mobile and web app
My question i can use Blazor WebAssembly for client-side web applications and ASP.NET Core for handling database interactions, APIs, and server-side processing. And, i can also use .NET MAUI for building mobile app all within the same solution.
I want to build a REST API for use with an Angular SPA.
My database is hosted on a SQL server through Azure.
A lot of online material I see when I search is for other types of databases or technologies.
I already have the database created.
How can I do this?
EDIT: I want to use ASP.Net Core for the API
but will use Angular to consume it.
I would recommend the following:
Architecture:
If your Angular SPA is Angular 2+ ( Typescript ): Setup a new .NET Core 3+ Web API project with entity framework (since it is a relational database). I would expose all the endpoints using swagger for .net and I would map all those methods on the SPA with a swagger client generator for Typescript.
If your angular SPA is not based on typescript, then I would not install swagger since the frontend is not strongly typed.
Hosting:
If you have an Azure account I would host both on Azure then you wouldn't have to expose your SQL Server to the web or create a VPN for that. Azure has also nice hosting for .NET Core projects.
If you need to make it really scalable
In this case, I would recommend you to publish this ASP.NET Core App building a container and have it running on Kubernetes or other container management server and have a load balancer to have the backend promoted with no downtime.
I've been reading and learing about the new Worker Service features provided in .Net Core 3.0. I have been using this link from Microsoft: Background tasks with hosted services in ASP.NET Core
What I don't understand is this, can these worker service concepts be introduced into an existing ASPNET Web Project, like a Razor Pages site? Or must you create a new project and then deploy that project as a service using whatever mechanism the host OS proivdes for that?
Yes, you can host any number of hosted services (IHostedService) within ASP.NET Core applications. With version 3, ASP.NET Core uses the generic host (Host.CreateDefaultBuilder) which is the framework that is hosting these hosted services when the application starts. In fact, the ASP.NET Core web application is an IHostedService itself.
To add additional hosted services to your ASP.NET Core application, just register additional hosted services with your service collection, e.g. within the Startup’s ConfigureServices:
services.AddHostedService<MyHostedService>();
That service will then launch together with the ASP.NET Core web server when the application runs.
The Worker SDK that is mentioned in the documentation is actually a subset of the Web SDK that you are using with ASP.NET Core application. Microsoft.NET.Sdk.Worker is basically Microsoft.NET.Sdk.Web without the web-specific stuff like Razor compilation and wwwroot folder stuff. It basically sets up automatic file globbing e.g. for the appsettings.json and does some other useful things that the core Microsoft.NET.Sdk does not have.
Ultimately this means, that when you are using the Web SDK, then you already have everything the Worker SDK offers. So you do not need to specify the Worker SDK just to host additional background services.
I have a large Visual Studio solution with several ASP.NET web sites with a mix of WebForms, MVC and WebAPI. What I'd like to be able to do is add an ASP.NET Core project to this solution to provide MVC, Razor Pages, WebAPI and SPA (Vue.JS in this case) facilities. The plan is to take each WebForms page at a time and convert to the new framework.
I'll target .NET Framework and the Core site will share some assemblies from the WebForms - but no state is shared except a session cookie and any state stored in the database.
I specifically want to be able to serve the new framework from IIS Express on the same port. So for example, an old page such as http://localhost:1234/page1.aspx will be converted to http://localhost:1234/core/page1. However, I'm unable to simply change the Core project to be hosted on IIS Express and change the path to http://localhost:1234/core. I have managed by following instructions to host in IIS but this has several disadvantages for development. I've also tried adding <urlRewrite> configuration to the WebForms site to forward requests to Core running on a different port but I wasn't very successful and I believe POST request are not supported which renders it fairly useless!
I have a service fabric stateless service which I am running inside my cluster within azure
At the moment the service in question only has 1 instance
I would like to be able to access data in the service via web api
How can I do this with .net standard not .net core?
There are a lot of links for creating web apis but they seem to be either Old or they refer to .net core
Some also give instructions for adding via visual studio which now doesn’t appear to be available within visual studio 2017
Paul
ASP.Net Core is only compatible with .Net Framework and .Net Core. Not .Net Standard unfortunately.
ASP.NET Core is a new open-source and cross-platform framework for
building modern cloud based internet connected applications, such as
web apps, IoT apps and mobile backends. ASP.NET Core apps can run on
.NET Core or on the full .NET Framework. It was architected to provide
an optimized development framework for apps that are deployed to the
cloud or run on-premises. It consists of modular components with
minimal overhead, so you retain flexibility while constructing your
solutions. You can develop and run your ASP.NET Core apps
cross-platform on Windows, Mac and Linux. Learn more about ASP.NET
Core.
https://github.com/aspnet/Home