Access Service Fabric cluster via .net standard with web api - service-fabric-stateless

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

Related

Migration of ASP.NET 4.6 Help Pages to .NET 6 (.net core)

In .NET framework we have support of Creating Help Page for Web API.
https://learn.microsoft.com/en-us/aspnet/web-api/overview/getting-started-with-aspnet-web-api/creating-api-help-pages
Does this feature supported in .NET 6. We are migrating our legacy ASP.NET framework application to .NET6.
How to migrate this feature to .NET6? If it is not supported in .Net6(.net core) how can we achieve the similar functionality in .Net core
I am trying to migrate this feature to .net core but I am facing issues on how to load the app data, register HelpdataConfig in .net core.
ITNOA
As you can see in ASP.NET help page for ASP.NET Core Web API, the Microsoft.AspNet.WebApi.HelpPage is for ASP.NET and does not for ASP.NET CORE or .NET 6, so you have to migrate this library to some popular Web API documentation libraries like Swagger
As you can see in ASP.NET Core web API documentation with Swagger / OpenAPI, you can use below documentation
By Christoph Nienaber and Rico Suter
Swagger (OpenAPI) is a language-agnostic specification for describing REST APIs. It allows both computers and humans to understand the capabilities of a REST API without direct access to the source code. Its main goals are to:
Minimize the amount of work needed to connect decoupled services.
Reduce the amount of time needed to accurately document a service.
The two main OpenAPI implementations for .NET are Swashbuckle and NSwag, see:
Getting Started with Swashbuckle
Getting Started with NSwag

Can ASP.NET CORE MVC be hosted in Xamarin App(Android)?

I have a ASP.NET CORE MVC (.NET CORE 3.1) application running well on Kestrel in Windows, Now I'm wondering if possible to migrate it to Android via Xamarin?
The purpose of this move is the lower cost of Android device.
And I noticed: Run ASP.NET Core 3.0 apps with MonoVM
but seems no details?
No, Not yet (Jan 2021).
Xamarin, NetFramework, Net5, NetCore3 all support NetStandard. AspNetCore is based on NetCore, not NetStandard. If AspNetCore was a NetStandard library, it would support it, but AspNetCore uses other libraries in NetCore which do not exist on Xamarin.
By the way, if you need just a simple web server running on android like Kestrel, you can use EmdedIO. Indeed it doesn't support MVC, MVP, and MVVM, so you can not run AspNetCore app on Xamarin:
https://github.com/unosquare/embedio

Can a Worker Service be called and/or used inside an existing ASPNET.Core web project?

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.

asp.net webapi core 3.1.self-hosted Kestrel app needs conversion to WIndows service

Have a working self-hosted WebApi exe using Asp.Net Core 3.1 and Kestrel and http. How can I convert that to a Windows service?
It was developed using Visual Studio 2019 Community, and also includes Serilog and Swagger, but uses a third party facilty (Actian OpenROAD Server) rather than a database.
I have searched lots of articles but nothing seems to specifically address this issue. The notes on starting from scratch using a "Worker" also do not help much and are mostly aimed at running background tasks for MVC.
Sorry but I have searched recent questions under various tags and cannot find a suitable answer.

How to enable trace.axd in ASP.NET core?

Our app is based on ASP.NET Core 2.0. It works fine in development environment but we see an oauth error when published to production.
All the documentation on asp.net core seems to point to using ILoggingxxx interfaces. The examples I found typically call logging.AddConsole() method so that the log lines can be viewed in VIsual Studio debug window. I am wondering if the good old trace.axd is still available under asp.net core. If so, I would appreciate the steps to enable tracing. Regards.
trace.axd is exclusive to applications based on .NET Framework and ASP.NET 4.x. It is not available in ASP.NET Core applications at all.