All Questions
Tagged with asp.net-core .net
6,404
questions
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;
...
0
votes
1
answer
72
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 ...
0
votes
1
answer
30
views
How can I write a HotChocolate middleware that acts after UseFiltering?
I am building a GraphQL interface in an existing dotnet webapi using HotChocolate v13.
I want to write a middleware in a field that has UseFiltering(), which as far as I know is a middleware as well.
...
0
votes
1
answer
69
views
Is there a way to make a Blazor website fully work offline?
We have a Blazor website made, but the client needs it to work offline.
I need to load all the data necessary when there is internet connection so that i can later use it in the pages. Not just ...
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 ...
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 ...
0
votes
0
answers
34
views
.NET 8 Angular and ASP.Net Core proxy config
I am working with the ASP.Net Core and Angular first time, so maybe the problem is easy to solve but I have not found a solution yet.
When the solution is create with the default visual studio ...
0
votes
0
answers
14
views
Using AzureB2C Invite flow prevents EnableTokenAcquisitionToCallDownstreamApi from working. Can I use two custom policies?
I'm trying to work with AzureB2C's invite flow from their samples
(https://github.com/azure-ad-b2c/samples/tree/master/policies/invite)
I have setup the two custom policies
B2C_1A_InvitePolicy
...
1
vote
4
answers
104
views
How to ensure a specific method is called after method chaining in C#?
I'm trying to create an API in C# that uses method chaining. I want to ensure that at the end of the chain, a specific method (e.g., Throw()) is called. If this method is not called, an exception ...
0
votes
2
answers
43
views
Set selected values in multi-select drop-down list in .net core 8
In my .Net 8 form, I have a multi-select drop-down list. The selected values are stored in the DB as a string delimited by commas e.g. A,B,C. How should I bind selected values to my drop-down list?
...
0
votes
0
answers
32
views
.net mvc project sdk package error: MSB4019: The imported project "../Microsoft.NET.Sdk.Common.targets " was not found
My project was working smoothly until a while ago I reopen it to find the following error when trying to build it (I'm using vs code)
I noticed sdk 8.0.107 being recently updated/implemented ...
1
vote
2
answers
40
views
Adding extra properties to ILogger<T> structured logging
Using ILogger<T>, is there a way to add log properties in addition to the ones covered by the message template?
For example:
_logger.LogInformation("Order {OrderNumber} was registered."...
0
votes
0
answers
52
views
Char code is different between .NET 4.8 and .NET 6
Previously with VB.NET (.NET 4.8) I have read files with the encoding windows-1252 in that way:
File.ReadAllText(filePath, Encoding.GetEncoding(1252))
Now in my ASP.NET Core 6 application I'm reading ...
0
votes
1
answer
32
views
RabbitMQ Client .Net Core Timing Out under load after rabbitmq upgrade. Consumer System.TimeoutException
We have a system that was running RabbitMQ 3.8.5 with RabbitMQ.Client 5.2.0. Part of the way the system uses rabbit is by creating a consumer to wait for a specific command from a different executable ...
0
votes
0
answers
26
views
Need to order by list using row value using entity framework [duplicate]
I have data in following format as shown in the sample table data. I want to order by this data in ascending order for ND values.
Means like from ND1 to ND10.
I tried the following way:
return await ...