9,744 questions
0
votes
0
answers
25
views
Cannot find how to skip authentication middleware for specifics paths
I am working on a small ASP.NET Core 8 Web API using the Minimal API template.
I'd like to be able to skip my ApiKeyAuthenticationHandler for the health check (/health path) to avoid noise in the log ...
0
votes
0
answers
34
views
How to add an existing Angular project into the same Git repo as my ASP.NET Core Web API (VS + VS Code setup)?
I am building a full-stack project where:
Backend: ASP.NET Core Web API (created in Visual Studio 2022)
Frontend: Angular project (created separately in VS Code)
Git: I initialized Git from Visual ...
1
vote
1
answer
92
views
Unable to create a 'DbContext' of type 'AppDbContext'. The exception 'Object reference not set to an instance of an object.' was thrown
I'm getting this error :
Unable to create a 'DbContext' of type 'AppDbContext'. The exception 'Object reference not set to an instance of an object.' was thrown while attempting to create an instance....
Best practices
1
vote
1
replies
79
views
Callback in ASP.NET Core with auth cookies
We have a strong use case, and I’d like your suggestion on how to solve an issue we're facing.
We built a banking system using ASP.NET Core that allows users to view their accounts.
Here's how it ...
0
votes
1
answer
57
views
"Response Content-Length mismatch: too few bytes written (0 of 152295)" When copying pages from a PDF to another using iText
I'm trying to read a PDF as MemoryStream, and copy pages from that PDF to a new one.
I'm using iText PdfReader and PdfWriter.
var ms = new MemoryStream();
using PdfReader pdfReader = new ...
2
votes
1
answer
182
views
XML output from ASP.NET Core Web API (Nautix compliant XML)
I am creating an ASP.NET Core Web API endpoint which will fetch XML output in the Nautix compliant XML. Despite the XmlAttribute set on the class, it does not return attribute in the output. Please ...
1
vote
0
answers
61
views
Docker container routing to YARP fails in Aspire
I have a software solution where there is
an ASP.NET Core 8.0 Web API running on Linux inside a Docker container (edge-service), making HTTPS GET and HTTPS POST to
an ASP.NET Core 8.0 Web API (front-...
1
vote
1
answer
53
views
How to debug and call .NET Core web API endpoints from USB connected Android device?
I'm trying to call my web API endpoints from Android device connected via USB, but I get this error:
failed to connect to /192.168.1.156 (port 7259) from /192.168.1.159 (port 41916) after 10000ms
...
0
votes
1
answer
76
views
How can I send my refresh tokens via httponly cookie to standalone blazor WebAssembly?
I've been trying for a couple days to implement refresh tokens into my ASP.NET Core Web API, but to no avail.
I've currently got an ASP.NET Core Web API that allows someone to log in with a username ...
0
votes
0
answers
46
views
Render deploy of ASP.NET Core Web API works but endpoints no
I'm trying to deploy an ASP.NET Core Web API on render.com, but it isn't working. The logs say it's something in the connection string, but I'm literally copying and pasting, there's nothing wrong ...
0
votes
1
answer
189
views
Having problem, implementing basic rate limiting properly in an ASP.NET Core 8 Web API
I am trying to learn using basic rate limiting in an ASP.NET Core 8.0 Web API. I set 'permit limit' to 5, 'window' to 1 minute and 'queue limit' of 2.
At this juncture, let me tell you that I have ...
1
vote
1
answer
46
views
Telerik Report Generation Fails in IIS on Azure VM with OperationCanceledException
I have an ASP.NET Core Web API that generates reports using Telerik Reporting. The report generation works perfectly in my local development environment, but when deployed to an Azure VM with IIS, it ...
1
vote
1
answer
68
views
How to handle error during customized scoped dependency injection
I have applied the multi-tenant location for EF Core database applying customize schema per tenant in my ASP.NET Core Web API project.
To do that the client send request through the API by setting ...
2
votes
0
answers
82
views
How can I accept a number with a leading 0 in .NET Core?
I'm responsible for maintaining a public ASP.NET Core 8 Web API. One endpoint accepts POST data like this:
{
"xid": 12345,
"message": "Hello, world!"
}
On the ....
0
votes
1
answer
80
views
How can I build and publish a SPA web application in Azure Devops?
We have built a React SPA web application with an ASP.NET Core Web API. The SPA and the backend are both in the same solution. So far this hasn't caused any issues running locally. When I created the ...
0
votes
0
answers
55
views
Extending Users Login Time
I'm working on a web project which using an ASP.NET Core 8 Web API in the backend and Vue 3 as frontend. Authorization process is handled with OAuth 2.0 and the app issues a token (valid for 10 ...
0
votes
1
answer
58
views
Why is my ASP.NET Core Web API not connecting to Elastic Cache Valkey
I am working on an ASP.NET Core Web API that is deployed to AWS. I am trying to integrate Elastic Cache using Valkey and working locally at the moment. This is my Program.cs:
using Amazon;
using ...
0
votes
1
answer
121
views
How to verify JWT tokens from Supabase in ASP .Net Core Web API?
I am trying to use supabase auth in my React with TypeScript and Vite frontend and it works there but when I try to access the API it is not able to verify the token and I do not undestand why? Is ...
0
votes
2
answers
140
views
How to map OData to correct endpoint in .NET 8.0 OData - Wrong Endpoint Called
We have an ASP.NET Core Web API which is running on .NET Core 3.1 which needs to be updated to .NET 8.0.
During the upgrade I noticed that a URI which maps correctly to one controller endpoint in .NET ...
0
votes
0
answers
124
views
How to make Dockerized ASP.NET Core 9 Web API trust self-signed signing certificate?
I have two ASP.NET Core 9 Web APIs running in Docker:
Identity API (OpenIddict server) – issues JWT tokens
Voucher API (protected resource) – validates JWT tokens using AddJwtBearer
Identity API ...
0
votes
1
answer
48
views
ASP.NET Core Web API not authenticating with Identity cookies from Blazor Server app
I have two ASP.NET Core applications:
Blazor Server app with Identity authentication (working correctly)
Web API that should share authentication cookies with the Blazor app
The API is not ...
0
votes
0
answers
52
views
.NET MAUI for Android in connection API localhost [duplicate]
I have a problem, I get this error
[0:] Connection failure: ERROR {0}
when using a connection in a .NET MAUI project for Android. I applied the Microsoft instruction for the case when the API works ...
2
votes
0
answers
100
views
Getting System.NullReferenceException in ASP.NET Core 8.0 Web API
I have an ASP.NET Core 8.0 Web API that is deployed in k8s.
What is happening is that after some time (random might range from 30 minutes to a day or more), the following exception is printed in ...
0
votes
0
answers
70
views
How can I enforce authentication for odata/$metadata endpoints?
I have an ASP.NET Core 8 Web API backend and I am trying to implement some OData searches.
I've followed this guide:
https://dev.to/renukapatil/odata-with-net-core-essential-concepts-best-practices-...
1
vote
1
answer
105
views
BadRequest is not returned when null is sent
I am writing unit tests. And I would like just test whether BadRequest is returned when null is sent into the method of controller.
So my code of method of controller looks like this:
public async ...