Questions tagged [asp.net-core]
ASP.NET Core is an open-source, cross-platform framework for building web applications. Use this tag for questions about ASP.NET Core applications. Use a specific version tag when your question is specific to a particular version of ASP.NET Core.
asp.net-core
117
questions
0
votes
0
answers
17
views
ASP.NET Core MVC: How to remove automatic encoding of html tags?
The program gets text with html tags from the SQLite database, then the text is displayed to the user in the browser. The tags are supposed to be automatically converted to html, but instead the tags ...
0
votes
0
answers
10
views
Cannot add Blazor Web Assembly project to ASP.NET Core .NET 6 application
I need to add Blazor Web Assembly project to ASP.NET Core .NET 6 application.
I did as described in this article How to integrate Blazor application
Removed builder.RootComponents.Add("#app"...
0
votes
0
answers
12
views
Azure Web App failing to deploy with Windows Containers
I'm trying to deploy a windows container that holds a simple ASP.NET Core Web App to an azure web app. I've created a container registry, and pushed my docker image to it. However, every time I try to ...
0
votes
0
answers
7
views
Serilog UI Authentication error while requesting /api/logs
I'm using Serilog UI as a part of my web app to allow users to check logs.
It's a docker containerized project which works fine in development environment (outside docker and on my dev machine) but ...
0
votes
1
answer
30
views
How can I write out the contents of objects to a text file?
I am trying to write out some objects in my .net core 2.1 web app into a readable format to a file.
I have these 3 objects:
var username = saml2AuthnResponse.ClaimsIdentity.Claims.ToList();
var ...
0
votes
1
answer
13
views
How to Reference a User Entity from Another Microservice in ASP.NET Core?
In my microservices architecture using ASP.NET Core, I have two distinct microservices: Identity.API for user management and PersonalAccount.API for handling personal account-related functionalities. ...
1
vote
0
answers
13
views
Model Parameter is Null in POST Method on Azure VM but Works Locally
I have an ASP.NET Core application that works correctly on my local machine but encounters an issue when deployed to an Azure Windows VM. Specifically, the model passed as a parameter to the POST ...
1
vote
1
answer
15
views
How to read the SAML response returned by IdP
I am trying to figure out how to get an email from the saml2AuthnResponse that is returned by the IdP.
I am not sure how to access this using ITFoxTec.
Here is my AssertionConsumerService code:
[Route(...
0
votes
0
answers
23
views
dropdown MVC don't keep focus for selected option
I have asp net core mvc application. After clicking filter controller recives propper data, but drop down always shows All option:
@{
ViewData["Title"] = "Index";
IsOpenFilterState ...
0
votes
1
answer
18
views
Asp.net core razor pages BindProperty collections List not Working
My plan is that I fill a list of data in OnGet and after sending it to the html page, I checkMark some lines and Fill some input on table, and finally it is posted to the server. But in OnPost, the ...
0
votes
1
answer
38
views
In web applications how to hide the sensitive data from software developers [closed]
We are developing an ASP.NET Core application using the MVC framework and SQL Server database. The application is intended for board members, and it's crucial that sensitive data remains inaccessible ...
0
votes
0
answers
32
views
Why does a SignalR connection not exist after starting the client?
I have a couple of clients that intermittently get the following exception:
Connection 'xxx' does not exist.
System.IO.IOException: Connection 'xxx' does not exist.
at Microsoft.AspNetCore.SignalR....
2
votes
0
answers
37
views
How to perform integration test on ASP.NET Core API controller endpoint that requires authentication and validation of antiforgery tokens
Description
I have an ASP.NET Core API controller endpoint that requires:
an authenticated user, and
validation of antiforgery tokens
I want to perform an integration test on this endpoint.
Problem
...
0
votes
1
answer
19
views
How do we use a value from a strongly typed configuration options class and have other services use it - for example AllowedHosts?
I have a strongly typed POCO class that is bound to Configuration Settings being retrieved from Azure App Configuration Services.
As an example, the strongly typed class is:
public class ...
0
votes
0
answers
25
views
Handshake Failure in ASP.NET Core Web API on Ubuntu 22.04 LTS
I have an ASP.NET Core Web API that was working perfectly on my Windows machine. I needed to deploy it on an Ubuntu Linux 22.04 LTS server. I followed this guide.
The application runs and can be ...
0
votes
1
answer
21
views
Using Serilog to log at various levels of verbosity across namespaces and classes
I was led to believe that I can set a global minimum level of Information and then in particular namespaces or classes I could bump it up to Debug or even Verbose. This is the code:
using Commons;
...
-1
votes
0
answers
24
views
Setting up a Next.js solution with a Node.js reverse proxy on ASP.NET Core app
We plan to render content with a NextJS with server-side rendering, client-side routing, working, and where the client app and backend are hosted in the same application. The client app is hosted in ...
0
votes
0
answers
14
views
How to resolve 'Application error: An error occurred in the application and your page could not be served' on Heroku?
I created a web app using asp.net core 6 and deployed it using heroku.
My MySQL DB is on aiven.io, and I can connect to it and ran all my migrations from my local to make sure everything is correct. I ...
0
votes
1
answer
73
views
How to loop through Inner list of object
I have a need where I need to loop through sublist of each class.
public Class A
{
public int IdA {get;set;}
public string Name {get;set;}
public List<Class B> Items {get;set;}
}
public Class ...
-1
votes
0
answers
23
views
VS2022 release build - wwwroot folder missing?
create app with template asp.net core web app ( Razor pages )
build in release mode
Does not have wwwroot folder in release directory /bin/release/net8/
Running in VS2022 showing the styling
Deploy it ...
-1
votes
2
answers
60
views
The service collection cannot be modified because it is read-only
I am using ASP.NET Core 8. I'm trying to resolve a dependency at app start up and then use it to manually register a second dependency.
But I am getting this error
The service collection cannot be ...
-1
votes
1
answer
32
views
Efficiently newing up DbContext without dependency injection
I'd like to write a ClaimsPrincipal extension that returns the company associated with a user has the IsLimited flag set.
public static class ClaimsPrincipalExtensions
{
public static bool ...
0
votes
0
answers
24
views
.NET Core ReactJS Deployment in AWS
When I deployed the Angular/React frontend and .NET Core docker backend in AWS EC2 Linux, there is an issue that the frontend can't call the backend using http:localhost:port inside ec2 locally.
Here ...
1
vote
2
answers
25
views
How to mock IConfiguration.GetSection("foo").get<Type>();
I am new to unit testing...
I have a class Settings.cs,
public class Settings
{
public string Format { get; set; }
}
and this is what the appSettings.json contains,
"AppSettings": {
...
1
vote
1
answer
28
views
Blazor .Net Core 8: How to use Server Side Component on the Client side?
I want to use the InteractiveAuto feature of WASM. So I want to create my pages on the client side.
But I also want to access server side components that have access to my SQL database.
It seems ...
-1
votes
0
answers
23
views
How do I get a .NET Core IIS site to select the proper appsettings.json when the environment variable changes?
The problem
IIS, .NET Core, or the site, do not seem to recognize a change to the system environment variable ASPNETCORE_ENVIRONMENT without a hard restart. For example, changing the value of the ...
1
vote
0
answers
19
views
Not Parsing Hindi When Converting HTML to Image in ASP.NET Core Web API
I am generating a card and downloading using api. One can enter a card number and card is generated and downloaded. But the card contains some hindi texts which is not rendering correctly in the ...
0
votes
1
answer
72
views
StringValues.Contains() always returns false
I'm trying to check if an Accept header includes a MIME type like this:
public static bool AcceptsView(this HttpRequest request) => request.Headers.Accept.Contains("text/html");
However ...
0
votes
0
answers
24
views
what layer should mass transit go in n-tier architecutre or clean architecture [closed]
hoping it's a simple question with a clear answer : what layer should mass transit be, one thing to note it's used as background service for now, that could be changed in the future who knows, the app ...
0
votes
0
answers
36
views
ASP.NET CORE Web API does not replace env settings on IIS
I have an API hosted in IIS.
In local testing, with very scenario, it works perfectly. When deployed to IIS, the appsettings.uat1.json did not get loaded and some environment variables are not changed....