318 questions
2
votes
0
answers
81
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 ....
1
vote
1
answer
97
views
How to cause an unhandled exception in ASP.NET Core 8 server app
There is this old thread about how deal with unhandled exceptions (How can I make something that catches all 'unhandled' exceptions in a WinForms application?)
Now I integrated this in an ASP....
1
vote
1
answer
122
views
ASP.NET Core 8 grpc Import "annotations.proto" not found
I have an ASP.NET Core 8 project and followed this article:
https://learn.microsoft.com/en-us/aspnet/core/grpc/json-transcoding-binding?view=aspnetcore-8.0
import "google/api/annotations.proto&...
0
votes
2
answers
679
views
Trouble with ASP.NET Core 8 & Angular project
I'm trying to launch the "Weather Forecast" template solution but encountering an issue I can't resolve.
Here's what I've done:
First, I installed Visual Studio 2022 and Angular 17 (npm ...
0
votes
1
answer
179
views
ASP.NET Core 8 - Configuration.GetConnectionString() returns null despite appsettings.json setup
I'm working on an ASP.NET Core 8 Web API project using Entity Framework Core. I've added my connection string to appsettings.json, but when I try to retrieve it using
Configuration.GetConnectionString(...
3
votes
1
answer
171
views
.NET 8 not communicating with grpc client
Grpc.Core.RpcException: Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: The SSL connection could not be established, see inner exception. ...
0
votes
0
answers
67
views
In a SOAP service in C#, the SoapCore library adds an extra root XML node, just before <soap:Envelope>
I created a SOAP service using
ASP.NET Core 8.0
SoapCore 1.2.1.8
The problem: when I get a request and response with an XML structured data, the API adds some root nodes that should be INSIDE the ...
0
votes
1
answer
52
views
ASP.NET Core 8 Razor Pages: Handler persists in URL after browser back navigation
I’m working on an ASP.NET Core 8 Razor Pages application where an Edit button on Page A redirects to a function in Page B's backend, which then navigates to Page C. The navigation works as expected.
...
2
votes
1
answer
143
views
NullReferenceException when checking if the Model is null on a Razor Page
I have a situation where I am getting a NullReferenceException when I am checking a model (not a property) to see if it is null. Follow these steps to re-create the issue yourself.
Create a brand new ...
0
votes
2
answers
328
views
How do I set default document for an ASP.NET Core 8 web app in Azure App Services?
First time experimenting with creating an ASP.NET Core 8 web application in Visual Studio Code. I chose .NET 8 because it's the newest version. I am deploying it via Azure App Services. I am very ...
0
votes
1
answer
154
views
Invoking IWebHostBuilder.UseStartup<Startup>() in an ASP.NET Core 8 project generates CS0246 (Startup could not be found)
I am trying to make a web application in .NET 8. I am following a Microsoft Learn tutorial for adding Entity Framework Core: https://learn.microsoft.com/en-us/aspnet/core/data/ef-mvc/intro?view=...
0
votes
1
answer
148
views
Global handle exception .NET 8
I'm working on a fairly standard ASP.NET Core 8 Web API project. I added a module to globally capture exceptions, and it works fine. But now I'm trying to standardize the responses in the controllers ...
0
votes
1
answer
104
views
Best practice for nested view models in ASP.NET Core 8?
I'm pretty new to web dev and have a question about how to best structure the project in currently working on. The project uses Entity Framework and ASP.NET Core 8 MVC.
In my database I have the ...
1
vote
2
answers
89
views
Blazor doesn't work in a Docker container
I have an ASP.NET Core 8.0 MVC (upgraded from .NET 6.0) project; it's working fine in a Docker container except for the pages that contain Blazor code. I'm getting an error
blazor.server.js:1 [2025-...
1
vote
1
answer
72
views
Error 401: "The signature is invalid" al validar JWT en .NET 8
I am developing an API in .NET 8 and implementing authentication using JWT with Microsoft.AspNetCore.Authentication.JwtBearer.
The problem is that when I send the token in the Authorization header as ...
0
votes
1
answer
254
views
After ASP.NET Core 8 Identity SignOutAsync, the user doesn't have to provide credentials to external log in
When using Blazor's IdentityComponentsEndpointRouteBuilderExtensions.cs logout method:
accountGroup.MapPost("/Logout", async (
ClaimsPrincipal user,
...
0
votes
1
answer
47
views
Identity Model Customization .NET Core 8
I am trying to access the UserRoles property from my ApplicationUser entity and I keep getting an error message stating Invalid column name 'UserId1'. I am following this Microsoft article (https://...
0
votes
2
answers
302
views
C# validation for JSON from request body against a model [duplicate]
I have an ASP.NET Core 8 Web API built with C#, and I'd like to add some validations to the request body for PUT operations. One of it is to ensure that requests coming to my API is matching exactly ...
0
votes
0
answers
51
views
Integrate NextAuth in .NET environment
I've developed an application utilizing Next.js for my client side, and an ASP.NET Core 8 Web API for my backend.
The auth flow is fairly simple. My backend issues short-lived access tokens, along ...
0
votes
0
answers
231
views
Microsoft Entity Framework Core [10100]
I have this form and when I try to submit the form, my DB gets a register with null fields, every field that supposed to fill in the form, I sent null, but the fields I've preset the value reaches the ...
0
votes
1
answer
58
views
ASP.NET Core 8: error controller method catches the error code, but does not display requested view
I'm using NLog so that when server gets error will direct action to ErrorController.
Program.cs:
app.UseStatusCodePagesWithReExecute("/Error/{0}");
app.UseExceptionHandler("/Error"...
0
votes
1
answer
72
views
Why does my ASP.NET Core Web API need access to the user's home directory?
We have an API that was originally written using the ASP.NET MVC framework and hosted on Windows Server. We have now ported it to an ASP.NET Core 8 Web API, and want to host on Linux (Oracle Linux 9). ...
0
votes
1
answer
102
views
ASP.NET Core 8.0 Zero-Downtime Deployment and DLL Lock Issue
I have a question: I am developing with ASP.NET Core 8.0 and have encountered some issues.
In a deployed environment, files like (ProjectName).dll are locked, preventing overwriting. I am curious ...
0
votes
1
answer
345
views
Spinning up Angular app with ASP.NET Core Web API on the same port using UseSpa library
I'll appreciate some assistance debugging my code to know what I am missing or doing wrong.
Please feel free to review related code at my git repository at this link https://github.com/slim1477/slim-...
0
votes
1
answer
273
views
ASP.NET Core 8 MVC consuming external API - where to maintain access token between requests?
I have an ASP.NET Core 8 MVC app. It consumes an external API that uses OAuth authorization.
In some action method of my controller, I need to obtain some data from the API. So I first make a request ...