Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
53 views

I'm encountering a frustrating dependency conflict in my ASP.NET Core 7 application involving different versions of BouncyCastle, and standard resolution techniques like binding redirects don't seem ...
Luke Puplett's user avatar
  • 45.9k
3 votes
1 answer
82 views

I have an ASP.NET Core 7 Web API service implemented in C# and a method defined like this: [ApiController] [Route("api/[controller]")] public class SensorsController : ControllerBase { //...
László Frank's user avatar
0 votes
1 answer
62 views

Short problem description: I can't make an internal API call to my controller class after using M365 authentication when starting my app. Retrieving ID or access token has not worked so far and ...
ComfortableOnion's user avatar
0 votes
1 answer
59 views

I have simple grid filled from an IEnumerable model and I can't pass it to the controller: @model IEnumerable<SkupinaKlientiVykazyModel> <form method="post" asp-action="...
Jan Šalomoun's user avatar
1 vote
1 answer
104 views

My user entity: public class User : IdentityUser<long> { public Office Office { get; set; } // not nullable // ...other custom properties } Suppose I want to create a new user: var ...
lonix's user avatar
  • 22.5k
1 vote
2 answers
125 views

To register some service against both interface and implementation: services.AddSingleton<IFoo, Foo>(); services.AddSingleton<Foo>(x => x.GetRequiredService<IFoo>()); That ...
lonix's user avatar
  • 22.5k
0 votes
0 answers
28 views

(sorry for my bad English) I had previously created an ASP.NET Core 7 MVC project and installed the dashboard. However, now I want to do authentication and authorization with the Microsoft.Identity ...
Emre Yeşilyurt's user avatar
3 votes
1 answer
669 views

Whenever I need transient or scoped services inside a singleton or background service, I create them in a child scope: using var serviceScope = _serviceScopeFactory.CreateScope(); var foo = ...
lonix's user avatar
  • 22.5k
0 votes
1 answer
471 views

I'm working on an ASP.NET Core 7 Web API, and I'm writing integration tests using CustomWebApplicationFactory. My program is making some external HTTP calls, so I want to mock them in my tests. I want ...
Jakub Kopyś's user avatar
0 votes
1 answer
58 views

This select will be populated normally: <select ... [email protected] asp-items=Model.Products> </select> Sometimes I want to render it as empty; I tried: <select ... @if (!...
lonix's user avatar
  • 22.5k
0 votes
0 answers
49 views

Consider a custom tag helper with this: [HtmlTargetElement("a", Attributes = "custom")] public class CustomTagHelper : TagHelper { [HtmlAttributeName("foo")] public ...
lonix's user avatar
  • 22.5k
0 votes
1 answer
59 views

I am rather new to .NET and I am trying to leave a session cookie in the browser and set its timespan. This is my Program.cs, more or less taken from tutorials and StackOverflow answers I found: using ...
Dan's user avatar
  • 584
0 votes
0 answers
159 views

I am trying to check how the caching works in in-memory and client side using .NET 7.0. For in-memory caching, I keep the results from database in a cached object and when the object expires it ...
AT-2017's user avatar
  • 3,149
3 votes
1 answer
105 views

I used .NET 7.x (ASP.NET Core 7 MVC) and JavaScript Library v1.10.2 and use XHR in Ajax to get data from the controller as shown here. Send a request to get data like this: function ...
Davood's user avatar
  • 5,657
0 votes
1 answer
58 views

I'm using ASP.NET Core Razor Pages with Identity. When a user navigates to some authorised route /secret (which he cannot access), the 403 page is shown as expected, but the runtime appends ?ReturnUrl=...
lonix's user avatar
  • 22.5k
1 vote
0 answers
170 views

I have /Admin/Home But I need /admin/home I tried many methods and nothing worked. I've been sitting on this for a long time, I hope someone can help me. I tried using the following: services....
ASAP Coder's user avatar
0 votes
1 answer
526 views

I'm using ASP.NET Core Razor Pages with Identity. I use the StatusCodePages middleware in the standard way: app.UseStatusCodePagesWithReExecute("/Error", "?statusCode={0}"); In ...
lonix's user avatar
  • 22.5k
2 votes
1 answer
128 views

I'm using ASP.NET Core Razor Pages 7 with Identity. Suppose I navigate to: /non-existent-page I expect it to show the 404 page, but it actually redirects to the login page and shows: /login/?return=%...
lonix's user avatar
  • 22.5k
3 votes
1 answer
472 views

I'm using ASP.NET Core's hot reload feature. It tries to connect with two websockets: ws and wss. The ws connection succeeds and hot reload works. But I'm not using HTTPS in my local development ...
lonix's user avatar
  • 22.5k
0 votes
1 answer
188 views

If I have a "page name" or "route name", and also route values, then I could create a URL in various ways: return RedirectToPage return RedirectToRoute Url.Action Url.ActionLink ...
lonix's user avatar
  • 22.5k
1 vote
1 answer
378 views

It seems the Angular redirection from with-in ASP.NET Core Web API is not working in a shared deployment. I am using ASP.NET Core 7 for the Web API. The current setup works perfectly with ASP.NET Core ...
VIRIYALA NARESH's user avatar
1 vote
1 answer
130 views

I wrote a custom DataAnnotations validator (for client and server): public class CustomAttribute : ValidationAttribute, IClientModelValidator { /* ... */ } However the docs show an alternate approach,...
lonix's user avatar
  • 22.5k
0 votes
1 answer
51 views

ASP.NET Core's <input> and <label> tag helpers support the asp-for property, which generates id, name and for appropriately. Is it possible to get those values somehow and use them on some ...
lonix's user avatar
  • 22.5k
0 votes
1 answer
65 views

I'm using the exception handler page as described in the provided link. However the ExceptionHandlerPathFeature doesn't provide all the details I'd like to use. This app is an ASP.NET Core 7 MVC web ...
Rob K.'s user avatar
  • 691
0 votes
1 answer
240 views

I've been struggling with setting up global error handling for my ASP.Net Core MVC Web App. I've been trying to apply the following article and I've had no luck. https://learn.microsoft.com/en-us/...
Rob K.'s user avatar
  • 691
0 votes
1 answer
777 views

When trying to run an integration test in .NET 7.0, I'm facing the following issue: An assembly specified in the application dependencies manifest (testhost.deps.json) was not found: package: '...
maj1n's user avatar
  • 13
0 votes
2 answers
343 views

I'm using ASP.NET Core 7. I have an update form which results in an http 400 error for large dataset updates. It works fine when the data being updated is smaller. The error I get is This page isn't ...
Kieran's user avatar
  • 316
0 votes
0 answers
58 views

I encountered an issue while configuring an ASP.NET Core 7.0 web application to run as a Windows Service (Windows 11), following the official Microsoft guide: Host ASP.NET Core in a Windows Service ...
PythonMCSJ's user avatar
1 vote
1 answer
329 views

I want to use Razor Pages and "MVC with views" simultaneously. So I used services.AddRazorPages() (which gives RazorPages and WebAPI) and then services.AddControllersWithViews() (which gives ...
lonix's user avatar
  • 22.5k
1 vote
1 answer
89 views

I have an ASP.NET Core 7 MVC project that has layout that looks like this. Image Default URL will be https://myurl/Home. My question is: when I click any menu at left tab to navigate to the page, what ...
user20239222's user avatar
0 votes
0 answers
83 views

Our application backend is an ASP.NET Core 7 Web API, frontend is React. I need to generate an OTP and send to a valid mobile phone number and then verify it. Is this not feasible for an application ...
ABC DEF's user avatar
  • 329
1 vote
2 answers
517 views

I'm using Razor Pages. Sometimes I need a page model file without the corresponding content file. But I must nonetheless specify a route for that page, and so define a content file anyway, just for ...
lonix's user avatar
  • 22.5k
0 votes
2 answers
117 views

I'm following microsoft's example for file upload operation in my blazor server project. And my API works in Swagger, in the page no files are transferred to my API layer. Here is my code - Razor page:...
Ali Bircan's user avatar
1 vote
0 answers
59 views

I use the Url.Page methods from UrlHelperExtensions. They return string?, which trigger analysers in my code. When can those methods return null? The class docs do not say.
lonix's user avatar
  • 22.5k
0 votes
1 answer
145 views

I created a custom IdentityErrorDescriber based on this approach, and registered it like so: services .AddIdentityCore<CustomUser>() .AddErrorDescriber<CustomIdentityErrorDescriber>() ...
lonix's user avatar
  • 22.5k
0 votes
0 answers
334 views

ASP.NET Core's cookie middleware can be configured like so: builder.Services.ConfigureApplicationCookie(x => { x.SlidingExpiration = true; // the default x....
lonix's user avatar
  • 22.5k
0 votes
0 answers
112 views

Somebody help me please. I'm using .net core 7. My register process works well. But I'm not able to return View. I use the Unit of Work pattern in Data Access Layer. Here is my IUnitOfWork.cs (from ...
user23476664's user avatar
-1 votes
1 answer
267 views

I have an ASP.NET Core 7 Razor pages project. It works fine on localhost, but when I upload the project to my web server on the internet, the first time it loads, it takes a few seconds to load the ...
keyvan's user avatar
  • 15
0 votes
1 answer
477 views

Sometimes I make changes in my IDE and don't want the page to be reloaded in the browser after I save. A typical scenario is that I make changes to the page via the devtools, and if the page is ...
lonix's user avatar
  • 22.5k
0 votes
0 answers
99 views

I have an ASP.NET Core MVC and Web API combined project that's published to IIS. Whenever an API call is made using HttpClient, I get a status 500 on the webpage. Logging the exception shows: System....
ollkar's user avatar
  • 3
1 vote
3 answers
5k views

I am in .Net 7.0 and in Program.cs we do not have any functions where there is a scope for dependency injection. The code is directly as follow: using Microsoft.AspNetCore.Mvc; using Microsoft....
K V Sharma's user avatar
3 votes
2 answers
300 views

I am trying to run PowerShell script from ASP.NET Core Web API. Please see the environment details below: .NET SDKs installed: 3.1.403 [C:\Program Files\dotnet\sdk] 7.0.200 [C:\Program Files\...
TechTurtle's user avatar
  • 3,267
1 vote
0 answers
572 views

k8s cluster on premises. 3x master, 2x worker nodes. I need to deploy 5x of my service replicas to my cluster. Service is an ASP.NET Core 7 Web API, using Entity Framework Core. When the API starts, ...
arturas's user avatar
  • 1,146
0 votes
1 answer
649 views

What is the correct way to retrieve spatial data from SQL Server and use it in my C# code? I am using the aspnetzero Angular web framework with the following related packages: net7.0 Microsoft....
juststartingout's user avatar
-1 votes
1 answer
123 views

Please I'd like to know why I can't use the namespace Microsoft.AspNetCore.Http.HttpResults, but I can use Microsoft.AspNetCore.Http.Results namespace has the Results class which gives us different ...
darul9061's user avatar
0 votes
0 answers
71 views

this query for make list of department every department have list of Employees then every employee has list of data about his attendance for that I use nested group in multiple layer then use nested ...
m-Esmaeil's user avatar
1 vote
1 answer
398 views

I am in the process of migrating a medium-sized .NET 4, ASP.NET MVC (old) application to .NET 7, ASP.NET Core MVC (new). I have a quite a few controllers with action methods that use simple types for ...
Oskar Sjöberg's user avatar
0 votes
1 answer
373 views

I get an empty Request.Body in the controller when I make a request to the controller from the frontend part, but if I use Postman, then everything works. When I sent request from Firefox, request ...
RNG_SMB's user avatar
-1 votes
1 answer
132 views

I always get invalid signature when I input the generated token in jwt.io Here is my code for making the token: private string GenerateJwtToken(string userID, string username, string issuer, string ...
Hossein Dadashi's user avatar
0 votes
0 answers
24 views

So I would like to get my GraphQL app running on an asp .net core 7 app, but the program always crashes. I cant seem figure out what is wrong with this. Not even the event viewer tells any useful ...
shanji97's user avatar

1
2 3 4 5
7