asp.net-core-5.0 Questions

3

Solved

I am writing integration tests for my app which uses .net5 I have used WebApplicationFactory with IHostBuilder for setting up environment. Custom fixture -> public class TestFixture<T> : W...
Surber asked 15/11, 2021 at 12:13

3

Solved

Deserializing using JsonSerialize.DeserializeAsync and a custom converter, e.g. public class MyStringJsonConverter : JsonConverter<string> { public override string Read(ref Utf8JsonReader re...

3

Solved

I have a component defined like this: public class MyClass { public MyClass(ILogger<MyClass> logger) { } } I don't know if the developer using this component will configure the logger wit...
Leadin asked 21/6, 2021 at 20:10

3

Solved

I'm trying to set up a logging mechanism using Serilog. I want to write the logs to both the file and a SQL Server database. Currently I can write the logs to the file system, but I cannot write to...
Reinhart asked 26/1, 2022 at 20:14

2

Solved

I've got an ASP.NET Core 5 Web API that uses Swagger to generate an OpenAPI3 json file. Using Visual Studo 2019 (16.8.2) on my Blazor WASM client, I've added a Service Reference to that json file. ...

7

Solved

In Bootstrap 4 I used the following sample code to update the title of the tooltip (where 'statusIcon' is the element, in this case is a font awesome icon, but same principal would apply for a butt...
Ulland asked 23/1, 2021 at 17:47

6

I'm creating a Profile for a user, adding columns to ApplicationUser and then executing the DbSet command at ApplicationDbContext. Just writing the DbSet command, it will throw an error: InvalidOp...
Hausa asked 30/6, 2021 at 13:50

1

I am trying to scaffold views based on a ViewModel in ASP.NET Core 5 project and have been finding it difficult passing through the following stage I used to be able to pass this stage by deleting...

2

Solved

I have used the package AspNetCoreRateLimit Version="4.0.1" and I get the following exception: Unable to resolve service for type 'AspNetCoreRateLimit.IProcessingStrategy' while attemptin...

3

Solved

I am trying to generate an OpenApi service reference in Visual Studio 2019. .Net 5.0. Right clicking project >Add>Connected Services>+ Service References I am using NetDocs api "https...
Proudfoot asked 28/6, 2021 at 16:28

2

Solved

I am trying to use the oidc-client with oppeniddict in the angular application but there is the error with .well-known/openid-configuration. Error says: GET http://localhost:2987/.well-known/openid...
Agio asked 4/6, 2021 at 13:8

1

Solved

I have a .Net 5.0 API project that stopped working after some recent changes. As there were many changes I still haven't found the reason for the problem that is causing this error: "InvalidOp...
Jayme asked 15/9, 2022 at 20:9

5

Solved

I am migrating to .NET 5.0 from .Net Core 3.1. I keep getting this error message: Package Microsoft.AspNetCore.Authentication.JwtBearer 5.0.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Vers...
Mureil asked 1/12, 2020 at 19:52

2

Solved

I have a problem with TLS 1.2 in ASP.NET Core 5.0 running on Linux. It's happening only in ASP.NET Core 5.0, the same code runs OK in ASP.NET Core 3.1 SSL Handshake failed with OpenSSL on Ubuntu 1...
Gardiner asked 5/7, 2021 at 23:48

1

Solved

I am working on migrating from Json.Net to System.Text.Json. I am not sure how we can build json object like below code using System.Text.Json. I tried lots of workaround but nothing seems working....
Lemmueu asked 16/6, 2022 at 4:26

2

Solved

Trying to roughly follow MSDN, I've added a hosted service after my scoped services in StartUp class. public void ConfigureServices(IServiceCollection services) { ... services.AddScoped<IUtili...

2

I'm using ASP.NET Core 5. As below, I'm using System.Text.Json: public IActionResult Index() { var result = GetAllMenuItems(); return Ok(result); } The expected shape of my JSON is: [ { &quot...

2

Solved

I create the BackgroundService: public class CustomService : BackgroundService { protected override async Task ExecuteAsync(CancellationToken cancellationToken) { //... } } and I added to the ...
Somatotype asked 21/6, 2021 at 8:55

2

Solved

The ASP.NET Core docs for background services show a number of implementation examples. There's an example for starting a service on a timer, though it's synchronous. There's another example which ...
Anthracosilicosis asked 27/3, 2022 at 13:30

1

I want to load an excel file into XLWorkbook using var workbook = new XLWorkbook("iFormFile needs to go here"); var ws = workbook.Worksheet(1);
Jeopardy asked 18/3, 2022 at 6:46

2

Solved

Constructor injection of a logger into Startup works in earlier versions of ASP.NET Core because a separate DI container is created for the Web Host. As of now only one container is created for Gen...
Involucel asked 25/7, 2021 at 11:44

1

Solved

Hey guys just a straight up question with no code. I am struggling mightily to even find basic answers to simple questions. How on earth can and should I use windows authentication (not integrated ...
Convoke asked 20/1, 2022 at 0:1

2

Solved

I'm having an issue regarding trying to compile my .NET 5 application to a single file executable while debugging through Visual Studio. My .csproject file is below. <Project Sdk="Microsoft...

2

Solved

On an AspNetCore 5 Web and API Projects I had the following on Program files: public class Program { private static IConfiguration Configuration { get; } = new ConfigurationBuilder() .SetBasePa...
Zoochore asked 15/12, 2021 at 15:19

2

I'm following along to these to guides: Scaffold Identity into an MVC project without existing authorization Create full Identity UI source After following the 1st guide I get what I expect for t...
Withindoors asked 26/11, 2020 at 2:11

© 2022 - 2024 — McMap. All rights reserved.