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
116
questions
0
votes
2
answers
36
views
When to close memory streams if they are returned in methods and controllers
I have some code that will be generating an excel report and I am planning on using it for some scheduled tasks but always wanted to return it from my API endpoint as well. My code for my controller ...
0
votes
1
answer
49
views
dotNET minimal API getting 404 not found on a secure endpoint
I am trying to implement a rest api using the dotNET framework. I am experiencing a problem with the "/secure" endpoint, getting 404 as a response message whether I login or not.
If I don't ...
1
vote
1
answer
47
views
.NET 8 Middleware Unexpectedly Changes Status Code to 204 After _next(context)
I am working on a .NET 8 Webapp. I have implemented a middleware to log requests and responses, but I'm facing an issue where the status code is unexpectedly changing from 200 to 204 after calling ...
0
votes
0
answers
25
views
apt-get not working in windows teamcity build
I have a simple docker file that installs curl for my container
FROM mcr.microsoft.com/dotnet/aspnet:6.0
run apt-get -y update; apt-get -y install curl
WORKDIR /app
COPY ["bin/Release/net6.0/&...
0
votes
1
answer
35
views
Blazor test page not opening Modal
I have the following code but when it renders to the browser it doesn't have an onClick call so clicking the button has no effect (go easy on me this is my first Blazor app):
I have a UserComponent ...
0
votes
1
answer
30
views
How do I use cshtml links inside a controller class?
I have an older ASP.NET Core 2.1 web app project.
I have a .cshtml page in this folder in my project:
G:\Projects\AccessApp\Pages\Privacy.cshtml
And I want to use it in my controller. I've tried the ...
0
votes
1
answer
48
views
Customize how a class instance is returned in ASP.NET Core responses
Given this class
public class ModelErrors
{
private Dictionary<string, List<string>> Errors { get; set; } = [];
public void Add(string propertyName, string value)
{
// ...
0
votes
2
answers
28
views
Is there a way to get different values from a single radiobuttonlist field used in ASP:Gridview
I am using a radiobuttonlist in my ASPX page inside a Gridview :
<asp:GridView ID="grdRampPrepQues" runat="server" class="table table-dark table-striped" ...
2
votes
2
answers
117
views
Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core
Recently upgraded my application to .NET 8.0.
Getting below error in Azure pipeline.
##[error]Error: The process '/opt/hostedtoolcache/dotnet/dotnet' failed with exit code 2
Info: Azure Pipelines ...
0
votes
0
answers
70
views
Local access by private IP to an ASP.NET Core application deployed in IIS 10
I'm trying to deploy my application in IIS 10. Access to app should be by private IP 192.168.....
In the section Edit Bindings I specified following settings:
Type: http; ip: 192.168....; port: 80
I ...
-1
votes
0
answers
35
views
Am I using KQL incorrectly, or is there another reason?
I using sdk 4.x version.
I refer
https://learn.microsoft.com/en-us/graph/search-concept-files#example-5-use-filters-in-search-queries
https://learn.microsoft.com/en-us/sharepoint/dev/general-...
2
votes
2
answers
58
views
How to Refresh IConfiguration
I am using .Net 8 DI to load IConfiguration on startup.
It will be loading key-values from azure keyvault.
But, after few hours the key-values would change.
So how to refresh IConfiguration ...
2
votes
2
answers
72
views
Check screen width in Blazor
Currently I use MudBlazor's MudTable and display a list of 3 columns, but when displaying the widths of the 3 columns are not equal. I used the CSS "width: calc(100% / 3)" and the 3 columns ...
1
vote
2
answers
65
views
How to set dynamic header titles in ASP.NET Core controllers using ViewBag
I'm working on an ASP.NET Core application and I have a base controller that defines a method to set a header title using ViewBag. I want to utilize this method in my Razor views to display dynamic ...
0
votes
0
answers
42
views
.net running on kestrel cannot start BackgroundService in staging/production environment
I have created a QueuedHostedService extending BackgroundService following official docs here. This runs just fine on development mode and I am able to step into/debug the task passed to the ...