37,950 questions
2
votes
1
answer
47
views
Validator access to database
My question is how do I need to validate fields. I have this class (request dto):
public class CompleteGoogleRegistrationRequest
{
public string IdToken { get; set; } = string.Empty;
public ...
0
votes
0
answers
44
views
Multiple Change Notification from Microsoft Graph, how to solve this?
I am trying to receive change notifications from Microsoft Graph whenever an event is updated (created, deleted, or updated).
I have successfully managed to create subscriptions. The URL that receives ...
0
votes
3
answers
141
views
Resolving a circular/recursive dependency with dependency injection
Say I have this interface:
public interface IExample
{
string GetSupportedExtension();
void DoWork(Stream input);
}
a concrete implementation like:
public class PdfExample : IExample
{
...
0
votes
0
answers
57
views
Autofac: ObjectDisposedException when resolving dependencies from factory delegate in ASP.NET Web API
I have an ASP.NET Web API project using Autofac for dependency injection.
I register a factory for creating ICommandExecutor based on an enum:
builder.Register<Func<CommandType, ICommandExecutor&...
0
votes
0
answers
42
views
How can I bind the results from a paginated ASP.NET Web API endpoint to a jQuery DataTables table in my ASP.NET MVC view?
I'm attempting to pass paginated results from a Web API to an MVC application and displaying in the View using DataTable. While I've successfully retrieved the data from the server and transmitted it ...
1
vote
1
answer
93
views
.NET - TestContainers many instance PostgreSql conflict
I'm writing integration tests in my .NET Web API. I'm using XUnit for this. I am using factory and collection. And everything works as expected. I run factory there I have used PostgreSql database ...
0
votes
1
answer
90
views
Routing in ASP.NET Web API
I'm trying to add a new Web API in a legacy web with VB.NET and .NET Framework 4.8. It has multiple Web API running correctly.
For example - CalendarController.vb:
<RoutePrefix("api/{...
1
vote
1
answer
53
views
How to Deserialize json document using reflection.emit.modulebuilder in system.text.json [closed]
We have a local Web API used for internal clients to retrieve data. We use application/json to transport the data across the Web API.
The retrieved JSON data has a simple structured class 'Response'. ...
0
votes
0
answers
107
views
AWS XRay Transaction Search Operation name - ASP.NET WebAPI
I am attempting to get Transaction Search in AWS CloudWatch up and running for our API (ASP.NET WebAPI).
I'm using the .NET AWS SDK and have XRay configured as follows:
public class WebApiApplication :...
0
votes
0
answers
25
views
How to use one ASP.NET Web API as OAuth authentication provider for another ASP.NET Web API on .NET 4.8
I have developed an ASP.NET Web API application to run on .NET 4.8. It generates JWT tokens using OAuth.
From my ASP.NET MVC application, I invoke above API endpoints to get access token.
Now, I have ...
0
votes
1
answer
86
views
How can I set up RabbitMQ in .NET Minimal Web API to then be able to use it in my services?
I want use AMQP connection string. I want to create a single shared connection (and channel per app lifetime to avoid resource exhaustion.
-1
votes
2
answers
86
views
Issue with sending emails with MimeKit
I've been trying to send a 'forgot password' email for my website. I am using a template html file with replaced text to send new randomized credentials to a user. I have so far been unable to send ...
1
vote
0
answers
48
views
SignalR Client does not connect with Web Socket and Server Sent Events Options but it connects with LongPolling
I used signalr with backend polling as a background service in my .NET web api project. However, when I try to connect to my hub from the client, it throws System.IO.IOExpcetion. I checked if web ...
0
votes
1
answer
59
views
ASP.NET Core API in Docker on Linux
I have created a ASP.NET Core Web API app with Docker enabled just using the auto generated boilerplate code. Running on Docker on my Windows dev machine works just fine. But when I deploy the app to ...
0
votes
0
answers
38
views
Sending tokens when redirecting
I am working with OAuth in my ASP.NET API for a web app + mobile app, anyway lets use Google as an example here the user authenticates using the Google provider then Google calls my API and I issue a ...
3
votes
1
answer
202
views
How to configure options to display StackTrace with AddProblemDetails() based on environment in ASP.NET Core?
I have my ASP.NET Core 9 Web API app using custom ExceptionHandlerMiddleware Middleware to handle all exceptions as shown below:
public sealed class ExceptionHandlerMiddleware(IWebHostEnvironment env, ...
0
votes
1
answer
39
views
Asynchronous File Validation Method Not Responding in Docker Environment
I'm working on an ASP.NET Core application running inside a Docker container. I have an API endpoint that processes a file asynchronously. The method picks a pending file, triggers an async validation ...
0
votes
1
answer
37
views
Multipart form post only works if you look at it first
I'm calling a rest endpoint that accepts a multi-part form data request. One of the fields is a file and I'm using a 42k test png image.
I'm using the HttpClient to make the request like so:
using var ...
0
votes
0
answers
47
views
App Authentication with ADFS, OpenID Connect and ASP.NET WebAPI 9.0
I have an iOS App that connects to an ASP.NET WebAPI on the server side for CRUD operations.
I now need to add authentication against a Active Directory Foundation Service (AD FS 2019) to protect the ...
1
vote
0
answers
65
views
No sharing cache, using IMemoryCache
My api depends on some programs that are expensive to start up for each call. I am trying to inject a cache that contains the cached objects wrapping the programs so they can be reused without killing ...
0
votes
1
answer
68
views
Getting error key name instead of localized message in API response
Example of values in ErrorMessages.resx
Or example in text
name: "OrderIsClosed"
neutral value: "Can't edit closed order."
uk-UA: "Не можна редагувати закрите замовлення.&...
1
vote
0
answers
53
views
Cross-domain cookie (.NET & React)
I have a hosted ASP.NET Web API on smarter asp, and I am accessing said API using a React application locally (localhost). The issue that I am facing is that the cookies are set in the response ...
0
votes
0
answers
104
views
ASP.NET Web API : "Error reading MIME multipart body part" exception
I'm having an issue when posting a file to my web server. I get this exception:
Exception raised during upload handling.
IOException: Error reading MIME multipart body part.
StackTrace:
at System.Net....
0
votes
2
answers
2k
views
Trying to use scalar with .net9, getting the error Request finished HTTP/2 GET https://localhost:7160/scalar/v1/scalar.aspnetcore.js - 404
Trying to implement Scalar in a .net9 aspcore app.
Doing the basics by using OpenApi. When i run it I see the UI but i dont see any of my methods. In the output window i see Request finished HTTP/2 ...
1
vote
1
answer
85
views
`git commit` in Github Actions workflow failing: Write access to repository not granted, 403
I have a .NET Core API project and using a GitHub workflow to build and deploy. I am using a GitHub Action to bump the version in .csproj upon each commit to the dev branch. To this point, it works ...