15,241 questions
1
vote
1
answer
32
views
ASP.NET Core MVC: How to make simple page with IEnumerable<XML>
I have a simple project where the start page shows a list of books. How to make the same page, but with display as XML?
Controller method:
public IActionResult Index()
{
// stored procedure
...
-1
votes
2
answers
101
views
ASP.NET Core Web API [NULL vs UNDEFINED]
In my HTTP controller using model binding, how can I determine if a request model property, is NULL because it was explicitly set to NULL by the API client, or is NULL because it was missing in the ...
0
votes
0
answers
30
views
Unable to set json as language in monaco editor
In my ASP.NET Core MVC view, I have the following code:
<script type="module">
import * as monaco from 'https://cdn.jsdelivr.net/npm/monaco-editor@latest/+esm';
document....
0
votes
1
answer
62
views
What are Areas for in ASP.NET Core? [closed]
What are areas in ASP.NET Core projects? I've been developing an application using the modular monolith design and a few example applications I saw used areas along with the MapDynamicControllerRoute()...
0
votes
2
answers
37
views
dropdown menu item doesn't drop down
I have an ASP.NET Core MVC web application. In _layout.cshtml, I have the following code, but it doesn't drop down in the menu bar it shows "manage" with a down arrow next to it below is the ...
-2
votes
0
answers
24
views
'IServiceCollection' does not contain a definition for 'AddIdentity' and no accessible extension method 'AddIdentity' [duplicate]
I am trying to add the identity to my project (which is using a Clean Architecture approach), but I get the following error
'IServiceCollection' does not contain a definition for 'AddIdentity' and no ...
0
votes
0
answers
25
views
Binding list of objects with dynamic form
Here's my current structure. Using a Pet example cause it's easier than explaining my domain.
Controller:
Manage endpoint
GetForm endpoint
Create endpoint (HTTP POST)
View:
Manage has the <form ...
0
votes
1
answer
33
views
How can I overwrite one item in an array in the appsettings stack when the item is moderately complex? [closed]
I have an ASP.NET Core MVC app using Serilog. Sinks are configured in the appsettings.json. I have a few sinks.
One of the sinks is not behaving. Typically I would overwrite the values of the ...
0
votes
0
answers
71
views
How to send model and some other parameters from javascript to controller using jquery.ajax?
I have an ASP.NET Core MVC project and I am trying to send a model and some other parameter from JavaScript to a controller action. First I fill the model from view fields whose names match the model ...
0
votes
1
answer
37
views
EF Core in-memory unit test fails
I am trying to unit test the Delete[Async] method in my repository.
The Delete method uses the "create - and - attach approach" rather then the "read-first approach" which would be ...
1
vote
1
answer
49
views
EF Core CLI: "Unable to create a 'DbContext' of type ''" error when running migration from multi-project solution
I'm working on an ASP.NET Core MVC application with a layered architecture (domain, infrastructure, web). I'm trying to run EF Core migrations from the GemsIrisDiMvc.Infrastructure project while using ...
0
votes
2
answers
102
views
Visual Studio - ASP.NET Core MVC / C# docker container app can't connect to the browser with 100% out of the box scaffolded code
I created an app with Visual Studio. Everything I did was an out-of-the-box selection. I picked ASP.NET Core Web App (Model-View-Controller) > Framework: .NET 8.0 (Long Term Support), ✔️Enable ...
0
votes
1
answer
58
views
After updating ASP.NET Core MVC from .NET 6 to .NET 8, the project property throws error
Recently, I have updated my ASP.NET Core MVC application from .NET 6 to .NET 8. The VS 2022 Professional was also updated to version 17.14.7.
After that, when I right-click my web project, which is ...
2
votes
2
answers
75
views
Ajax POST returns undefined from ASP.NET Core Web API with no errors
In my ASP.NET Core MVC web app project, I'm sending a POST request to an external API using HttpClient. Everything seems to be working correctly, but on the JavaScript side, the response is undefined. ...
0
votes
0
answers
87
views
ASP.NET Core 8.0 Microsoft authentication error - AuthenticationFailureException: the oauth state was missing or invalid
My setup:
ASP.NET Core 8 MVC application, configured to act purely as an API (returns JSON, no traditional views)
Frontend: React application running on http://localhost:3000
Backend API: running on ...