15,252 questions
1
vote
0
answers
37
views
Required data annotations returning namespace rather than error message value?
I have an ASP.NET Core 8 MVC application, using the bog standard [Required] attribute on a class property. I expected to see the defined error message in my HTML, in the data-val-required attribute on ...
0
votes
1
answer
45
views
ASP.NET Core site can't find Default route on startup
I add a route named default with the pattern
{controller=Assets}/{action=Index}/{id?}
but I get an http 404 "Not Found" error.
If I type in /Assets in the browser, it finds the view, it's ...
0
votes
0
answers
53
views
ASP.NET Core 8 Code Generator error: "Minimal hosting scenario! InvalidOperationException"
I'm working on an ASP.NET Core 8 MVC project with a layered architecture:
Main project: FarazFactoryManagement (contains Program.cs)
Data layer: DataLayer (contains my AppDbContext and model classes)
...
0
votes
0
answers
37
views
JSON output doesn't add the new line on my model file in ASP.NET Core MVC
I'm going to get straight to the point: my model file Vanexo3_h was missing the parameter puertoembarque, so I decided to added so I can print that in a PDF viewer on my system. The problem is that ...
3
votes
2
answers
118
views
Error when accessing data, EF Core seems to create its own column
I have a project that has uses a database-first approach. I have used db-scaffold to create the models and have also created 'custom' models to contain extra info and code.
I have a model class ...
1
vote
0
answers
116
views
NLog does not archive the file
In my WCF / C# project, I am using Nlog, it successfully creates logs inside the current date folder, but it does not archive the log files.
NLog.config:
<nlog xmlns="http://www.nlog-project....
1
vote
1
answer
152
views
Prevent trace exports for the Metrics endpoint with OpenTelemetry
I have this easy setup in my ASP.NET Core web app:
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions....
0
votes
2
answers
79
views
FluentValidation with ASP.NET Core MVC: DTOs without data annotations still trigger default "is required" messages
I have an ASP.NET Core 9.0 MVC project where I use DTOs for input binding and FluentValidation 12.x for validation.
Entities exist separately and contain data annotations attributes like [Required] ...
0
votes
0
answers
83
views
Define execution hand-off point in .NET Core [duplicate]
I'm developing a simple web app that will (roughly) do the following:
Receive request to do something
Send back an acknowledgement response
Call the function that does the thing (the "execution ...
1
vote
1
answer
56
views
ASP.NET Core MVC: have button on Details view take you to another model's Create view and have the primary key value copied into field
I have a Details view (PIF model) that contains views of several models at the bottom. Screenshot shows the Internal Comments model data underneath the last row of PIF model data.
The PIF model has a ...
1
vote
1
answer
61
views
ASP.NET Core MVC Edit GET works but POST results in ArgumentNullException: Value cannot be null. (Parameter 'items') despite debugging showing data
I'm sure this is something really obvious but I've spent hours (including a lot of Googling) on this and I am stuck.
I am able to create a record (along with the Fluent Validations firing where need ...
0
votes
1
answer
41
views
Script debugging and Entra ID (B2C) can't both be on at the same time
I have a Visual Studio ASP.NET Core MVC app with lots of Javascript / TypeScript that I need to debug. Up to now, I have been successfully using the Script Debugging feature.
I have now incorporated ...
0
votes
1
answer
79
views
404 not found js css assets with ASP.NET Core MVC, vite/vue web app
I'm having trouble with an ASP.NET Core 8 MVC app with vite vue. My app runs locally in which I mound in a cshtml div id= app all the vue components.
Locally the vite server runs and everything is ...
0
votes
0
answers
66
views
ASP.NET Core MVC Identity is not confirming email account addresses on registration
I have an ASP.NET Core MVC website that uses individual accounts with the Microsoft Identity provider. I used the Visual Studio scaffold option to add the Identity user accounts to my project, but I ...
1
vote
1
answer
51
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
...
0
votes
0
answers
57
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
3
answers
61
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 ...
0
votes
1
answer
45
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
1
answer
73
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 ...
0
votes
2
answers
148
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 ...
2
votes
2
answers
95
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. ...
1
vote
2
answers
73
views
ASP.NET Core MVC with Razor - how can I repopulate a view with new model data?
The use case is this: the user can enter a client number and I can then do an API call and get all their information and repopulate the form.
The form is say at /Users/Add.
I don't want just reload ...
0
votes
0
answers
87
views
ASP.NET Core 8 MVC app in IIS fails to start – still trying to open one file
I'm trying to host an ASP.NET Core 8 MVC application on IIS (Windows 10), but the application fails to start. The browser just hangs, and in the Event Viewer I noticed it's trying to open a file, ...
1
vote
1
answer
98
views
Integration between DataTables and ASP.NET Core MVC: form doesn't read all values
In my ASP.NET Core MVC project, I have a page where I use DataTables. I added the code to render the table names logs with DataTables.
$(document).ready(function() {
var logs = $('#logs')....
0
votes
0
answers
59
views
How to configure a separate admin app to manage accounts for a web app in ASP.NET?
I am developing an app that uses ASP.NET Core Identity to manage user accounts. Users are not able to create their own accounts for this app. A separate admin app will be used to create accounts for ...