skip to Main Content

How import WebApplicationBuilder in a Class Library? – Asp.net

I want to create an extension method for WebApplicationBuilder: public static void AddData(this WebApplicationBuilder builder) { var connectionString = builder.Configuration.GetConnectionString("DefaultConnection"); builder.Services.AddDbContext<ApplicationDbContext>(option => { option.UseSqlite(connectionString); }); } this method works in a project that use: <Project Sdk="Microsoft.NET.Sdk.Web">, but if I put…

VIEW QUESTION

URI to Bitmap C# ASP.NET

I am capturing a URI in ASP.NET MVC with webcam.js. I would like to turn this URI to to bitmap in C#. Below is my current code for attempting to parse the URI into a bitmap, but it, but it…

VIEW QUESTION

How to track dependencies, exceptions and requests for Live Metrics in ASP.NET MVC app?

I've configured Live Metrics for my ASP.NET MVC app with target framework 4.7.2 using the tutorial given in Microsoft Docs: https://learn.microsoft.com/en-us/azure/azure-monitor/app/live-stream#enable-livemetrics-using-code-for-any-net-application In this tutorial, they've given a sample client.TrackDependency() and client.TrackRequest() call in the end. They've also mentioned in comments…

VIEW QUESTION
Back To Top
Search