83,821
questions
1
vote
0
answers
21
views
OData orderby Enum Type throws exception
I have an entity defined as follows, which encounters issues when trying to sort by the TheType property:
[Serializable]
[Authorize]
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
...
0
votes
0
answers
17
views
Why is Application Insights showing no events
This is for a Blazor Interactive Server app. I add it to the app using:
builder.Logging.AddApplicationInsights();
builder.Services.AddApplicationInsightsTelemetry();
I then add an event using:
// ...
-1
votes
1
answer
32
views
Uncaught TypeError: $(...).froalaEditor is not a function.... This is my problem [duplicate]
I have conflicting jquery versions, the lastest jquery 3.6.0 and then Froala's 2.4.2 I believe. As the process loads jquery and then Froala they interact and Froala overwrites the 3.6.0. I need both ...
0
votes
0
answers
29
views
Current Process' Handle Count constantly goes up in my ASP.NET Core application
I am monitoring number of currently open handles in my asp net application using prometheus-net library and this value constantly goes up during the application lifetime. So as I understand process is ...
0
votes
1
answer
27
views
.NET Core Multi Tenancy authentication
I have an application hosted in Azure (Tenant A).
I also have tenant B in Azure. There are users split in either tenant A or tenant B (Azure Active Directory) that requires login to this application.
...
0
votes
0
answers
16
views
ASP.NET AddAuthorization with additional claims - resolving options from service provider
Using ASP.NET (AspNetCore 8, net8.0), I want to add additional claims for authorization. Our current code looks like this at the moment:
var config = configuration.GetSection("Auth").Get<...
0
votes
0
answers
16
views
Cannot establish HTTPS connection when running as a Windows Service
I have 2 Software applications:
An interface software that normally should run as a Windows service
and an emulator whose goal is to test this Windows service
Both are
written in ASP.NET Core 3.1,
...
3
votes
1
answer
38
views
Variable does not exist in the current context in Blazor component
I am building a Blazor (Blazor server) project in .NET 6 and I have come to a problem, in one component I can declare a variable, but when I try to do something with that variable immediately after I ...
0
votes
0
answers
12
views
Middleware Not Invoked After Authentication in API Gateway with Multi-Tenant Setup
I'm working on an API Gateway using Ocelot for request routing and IdentityServer4 for authentication. The setup involves a multi-tenant system, where the tenant information is resolved using the ...
1
vote
1
answer
32
views
Object as a Scoped Service, With Values being Set in Middleware, Sometimes Remains Null
I use the following to create an instance of a class for storing user information during the request:
services.AddScoped<IUserSettings, UserSettings>();
Then I use middleware to set the values ...
0
votes
1
answer
53
views
ASP.NET Core - error 404.15 after adding authorization services
I am working on an ASP.NET Core MVC project and recently added custom authorization services to my Program.cs file:
After doing this, I encountered the following error when accessing my application:
...
0
votes
1
answer
60
views
.NET Core / Entity Framework Core not updating, seemingly referencing a migration history database even when it doesn't exist
dotnet ef migrations add X
This works and adds three files (if there are no other migrations at all) in the migration folder, X.cs, X.Designer.cs and QuizzDbContextModelSnapshot.cs.
dotnet ef ...
0
votes
0
answers
29
views
Isolated css in Blazor .net 8 WASM didn't work
I have a solution as described in title.
(I'm new in blazor) I worked few times on new solution. On one day, before close solution css works fine. Next day when I start solution, it didn't see css. ...
0
votes
2
answers
57
views
401 after I add [authorize] to my endpoint, logs included
Nothing is working I tried everything, chatgpt, docs I think something is wrong but I don't know what!
My frontend is swagger, also when I check my JWT token on jwt.io, it seems to work.
Here are the ...
0
votes
2
answers
42
views
Why am I getting this Content Policy error?
I have added the following to my Blazor Interactive Server app using NWebSec:
app.UseHsts(options => options.MaxAge(days: 30));
app.UseXContentTypeOptions();
app.UseXXssProtection(options => ...
2
votes
0
answers
26
views
IAsyncCollector<SignalRMessage> equivalent in .net 8 isolated version
I have an Angular app which calls this Azure Function app.
With .NET 6.0 in-process, this code is working fine and sending messages using SignalR:
[FunctionName("SendMessage")]
public static ...
0
votes
1
answer
27
views
Exclusions from Blazor SSR parameterised pages
I have a Blazor SSR page with a simple domainname/{urlparam} page route, the urlparam is then used to dynamically show different page content; I can't change the URL pattern. It works fine but I've ...
0
votes
2
answers
42
views
How to get all the values of jQuery datatable columns in all rows which contains dropdownlist
I have 5 columns in my jQuery data table and the fifth one is a dropdown list as shown below:
enter image description here
I want to save the data in this data table. So I want to iterate through all ...
0
votes
1
answer
97
views
What is the correct way to handle models and entities in clean architecture? [closed]
So I'm trying to set up all the basics for a new .NET application. It's a Blazor app, to be created with clean architecture and code-first EF Core.
In my domain layer I defined some entities which ...
-3
votes
0
answers
34
views
What am I missing in my Context Security Policy?
I am using NWebSec in a Blazor Interactive Server app. I am setting the CSP using:
app.UseCsp(options => options
.DefaultSources(s => s.Self()
.CustomSources("https:"))
...
0
votes
1
answer
52
views
When are tag helper components executed?
TL;DR: In ASP.NET Core, in what moment of the render pipeline are Tag Helper Components executed/processed?
For example, are they executed after their targeted tag is rendered, or after the whole page ...
1
vote
1
answer
20
views
ASP.NET Core - Deserialize Cities API XML response not working
When calling cities API, it returns this response in XML format. I want to deserialize this XML into an object. Deserialization grabs objects till diffgram inside diffgram we have the NewDataSet ...
0
votes
1
answer
19
views
How to generate COMMON KEY RING to Share cookies across subdomains?
I want to share authentication cookies between main and subdomain in ASP.NET core (.NET 8).
After reading this article about Share authentication cookies with ASP.NET Core Identity, I'm confused about ...
0
votes
1
answer
39
views
How to return a TypedResults.UnprocessableEntity in an ASP.NET Core Minimal API?
I'm trying to return an fffff from a Minimal API. When I set up the return type, I get a weird error:
the non-generic type 'IResults' cannot be used with type arguments.
public static async Task<...
0
votes
0
answers
21
views
ASP.NET Core doesn't create an authentication cookie when SameSite is set to none
I want to test a cross-domain authentication after some research it seems SameSite for authentication cookie should be set to none as below:
options.Cookie.SameSite = SameSiteMode.None;
The problem ...
0
votes
2
answers
53
views
Azure Env Variables not being picked up
I have a web app on Azure that I am trying to connect to a mysql db hosted on aiven.io. The connection works if I hard code the connection string in appsettings.json. When I enter the exact same ...
-1
votes
0
answers
34
views
Entity Framework Core: error instance of entity type cannot be tracked
I'm saving a list of records (55,000) at single time using Entity Framework Core with this code in .NET 8:
await _context.Associatedjobs.AddRangeAsync(Allassociatedrecords);
await _context....
0
votes
0
answers
14
views
The RabbitMQ delayed message plugin publishes and consumes messages successfully, but the messages are not enqueued from the delayed event bus
I am using the RabbitMQ official Docker image and have activated the delayed message plugin. Everything works fine, but sometimes after publishing a delayed message, it gets consumed successfully but ...
1
vote
2
answers
38
views
How to Dynamically Update JWT Bearer Options in ASP.NET Core Middleware?
I’m working on an ASP.NET Core application that uses JWT Bearer authentication. I need to dynamically update the JWT Bearer Backchannel, during runtime without restarting the application.
After the ...
0
votes
1
answer
50
views
How to tell whether an Endpoint is an ApiController?
Does an Endpoint obtained from an EndpointDataSource contain any information that identifies the route as an ApiController?
XY: I want an IMiddleware to require a cookie for all requests except API ...
0
votes
0
answers
8
views
DevExtreme 1 or more validation errors when trying to Post
I am doing an app using React TypeScript with DevExtreme and .NET 8 as backend, but I am having trouble adding a datagrid which can be interacted with. The most I could get it to do was to show the DB ...
0
votes
0
answers
52
views
Upload Multiple Images to File Path and Database
I'm using ASP.NET Core MVC, C# and EF Core code-first.
I'm running into an issue that is not allowing me to upload multiple files to my folder and the corresponding path to the database table. The ...
0
votes
1
answer
31
views
Blazor drag/drop does not respect preventDefault and downloads file
Consider the following Blazor markup:
<div class="drag-drop-area @this.Conditional(isDragging, "drag-over")"
@ondragenter="OnDragEnter"
@ondragenter:...
0
votes
0
answers
31
views
How to map a user attribute to a standard OIDC claim in keycloak
I have a docker container with Keycloak.
I am trying to understand how the authentication works, especially with regards to claims mapping.
I have created a realm and in Realm Settings > User ...
2
votes
1
answer
54
views
Mapping multiple columns value to dictionary entity property
I have an existing on-premises application that works without Entity Framework.
Each customer has its own installation and different SQL Server database instance.
All the databases have the most of ...
1
vote
0
answers
23
views
Datadog ingest only 1% of span, DD_SPAN_SAMPLING_RULES is not working
I am developing a microservice using ASP.NET Core. We are using Datadog.Tracer library for distributed traces & span. Currenlty it is collecting all the spans and traces. I only want 1% of spans ...
1
vote
1
answer
46
views
How to Reference Microsoft.NET.Sdk.Web class from a non-web project? [duplicate]
I have a class library (vintage .NET Core 2.x) that I'm upgrading to .NET 8. There's a method that returns SelectListItem from the namespace Microsoft.AspNetCore.Mvc.Rendering. Like this:
IEnumerable&...
0
votes
1
answer
69
views
ASP. NET Core 8: Error HTTP 500 and returnurl=%2F in the URL
I'm encountering a HTTP 500 error when trying to log in with ASP.NET Core Identity. The error occurs after submitting the login form with valid credentials, and the user is not logged in.
After ...
0
votes
2
answers
46
views
ASP.NET Core Razor pages web app: in the OnPost the request has data in the Items list but in the OnGet the list is empty
What am I doing wrong?
I have not used ASP.NET Core or EF Core in a long time so I'm relatively new to it.
When I debug with breakpoints in the OnPost the Items list has data, but when the page is ...
-1
votes
1
answer
33
views
File upload works from Swagger, but fails in REST API client , says 413 Request Entity Too Large
My .net core rest api with IIS server setup is able to upload files through the Swagger UI, but it fails when I try to upload from REST API client (Postman or Insomnia) saying "413 Request Entity ...
0
votes
1
answer
30
views
"Error MSB4018: The "Message" task failed unexpectedly" for ASP.NET Core 8.0 build
I am building an ASP.NET Core 8.0 application for arm64 via a github action. Upon the dotnet restore command, the error in the title is thrown and the build process is aborted. I am building the asp....
0
votes
0
answers
21
views
Guidance performing unobtrusive stepup authentication in blazor web (.net8)
Looking for a discussion on how to perform unobtrusive step-up authentication in blazor web (.net8). I'm specifically trying to do this with Duende idp, but I would assume it would apply to all OIDC ...
0
votes
1
answer
46
views
YARP How to set up a reverse proxy for another full web server in a sub path?
I have a Qliksense server from domain and I have its certificate (.pfx) and I want to make a reverse proxy to it with ASP.NET Core + YARP.
The issue is when I set the proxy prefix as /qlik for example
...
0
votes
1
answer
42
views
EF8 handling string nullability: required, set vs init
How should string nullability be handled in EF8? Should I use the required keyword? Also should I choose set; over init;? I remember there were some issues with init; in .NET 6.
public class ...
-2
votes
0
answers
25
views
Versioning in MVC core [duplicate]
builder.Services.AddApiVersioning(options =>
{
options.DefaultApiVersion = new ApiVersion(1, 0); // Set default API version to 1.0
options.AssumeDefaultVersionWhenUnspecified = true; // ...
-1
votes
0
answers
55
views
Can't fix Error 400 when creating new contact in web app
I need to make a contacts list for my faculty practice. The thing is that every contact can have multiple emails and phone numbers, but at first I've made it so they can have only one of each. So now ...
0
votes
0
answers
21
views
Google Cloud Speech-to-Text API: Unauthenticated Error in Production but Works in Development
I'm using the Google Cloud Speech-to-Text API in my ASP.NET Core web application, and it works perfectly in my local development environment. However, when I deploy the application to the production ...
2
votes
0
answers
87
views
.NET Dapper SqlMapper slow query execution
In .NET 8 with Npgsql and Dapper, our query is incredibly slow compared to executing it directly through another database manager.
In our code, we execute queries as such:
var query = "select ...
0
votes
1
answer
31
views
Process one request and enqueue other requests using Semaphore in Middleware
I am using semaphore to handle one request at a time and enqueue other request and process in sequence. But when I run the code it run first request and drop other request. What I am doing wrong here?...
1
vote
1
answer
44
views
Serilog ignoring overrides
I am setting an override in the appsettings.json like this:
"Microsoft.AspNetCore.Hosting.Diagnostics": "Warning"
However, I'm still getting logged events at the Information level ...