All Questions
Tagged with .net-6.0 asp.net-core-webapi
298
questions
0
votes
1
answer
30
views
Unable to send a local image that isn't under wwwroot to openai using its new .NET library
I have an ASP.NET Core 6 Web API with the new official library from OpenAI (https://github.com/openai/openai-dotnet).
What I'm trying to do, is to use a local image file to OpenAI. The file isn't ...
0
votes
1
answer
75
views
403 from Azure only in a specific endpoint with specific version of the API
We developed a middleware service Web API app in .NET 6 with several endpoints and deployed it to Azure. We get a strange error with an endpoint that implements a POST method.
If we change the version ...
0
votes
0
answers
29
views
ASP.NET Core 6 Web API : password popup on new server
We are moving to a new Windows Server 2022 and when using Swagger, some users are experiencing a popup window asking for username and password when trying to run an operation. Others are able to run ...
0
votes
0
answers
61
views
ASP.NET Core 6.0 Web API : cannot context switch to another account to start an executable
I have an ASP.NET Core 6.0 Web API that runs on IIS 7. The application pool is running under an account local to the machine but not the local system, call it 'local-system-web-account'. I am trying ...
0
votes
1
answer
38
views
Minimal API Swagger doc keeps returning 404 when published to IIS
I have an ASP.NET Core 6.0 Minimal API. When I run it in IIS Express from VS, Swagger works just fine, but I want to publish it to IIS on my device so I don't always have to run it from VS.
Problem is,...
0
votes
0
answers
45
views
Inconsistent CORS errors in React UI calls to ASP.NET Core 6 Web API
A React app is calling my ASP.NET Core 6 Web API. Things have been working fine for months with no CORS problems.
Starting this week, I started seeing the React client unable to call the API ...
0
votes
0
answers
92
views
How to handle expired JWT tokens without exceptions in .NET Core?
I'm working on JWT token generation and validation in .NET Core. Here is the code I use to generate my token:
string GenerateToken()
{
var securityKey = new SymmetricSecurityKey(Encoding.UTF8....
0
votes
0
answers
26
views
Missing information in AWS-Xray
I have .net 6 web api running in a aws lambda. I have enabled the x-ray tracing in lambda and also made code changes in api
AWSSDKHandler.RegisterXRayForAllServices();
var app = builder.Build();
app....
1
vote
1
answer
41
views
ASP.NET Core 6 Web API : use queryString on complex json can not bind successfully
When I use the GET API to send a complex JSON format, the backend cannot obtain the data correctly.
This my query string data:
{
"page": 1,
"page_size": 10,
"...
1
vote
1
answer
57
views
Request Body mixed together when getting successive requests in ActionFilter C# .Net 6.0
We have a custom action filter that does XSD validation on request bodies to ensure that the XML is validated before the controller action is hit. We created an extension method to read the payload ...
0
votes
1
answer
84
views
FromBody and FromHeader attributes together in .NET Core 6
I have a model RegisterCustomerRequest:
public class RegisterCustomerRequest
{
public int Code { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public ...
0
votes
2
answers
101
views
ASP.NET Core 6 Web API : use System.Json.Text ModelBinding error message is not correct
I post the data by [FromBody], can not get the correct error message, but use [FromForm] can.
I have a model like this
public class ReservationReplyViewModel
{
[Required]
public DateOnly ...
1
vote
0
answers
196
views
The SSL connection could not be established, see inner exception in ASP.NET Core 6 Web API
I have an API, which when tested on my localhost works fine, but on the server, when I call it in the published one, I get the error:
The SSL connection could not be established, see inner exception
...
1
vote
2
answers
105
views
ASP.NET Core 6 Web API base project with multiple API projects
I have a project called backend-sandbox. I want this project to be the startup project of my solution. Once I run this project, it should run all the other projects dependent on it.
Other projects can ...
1
vote
1
answer
39
views
ASP.NET Core Web API endpoint validating nullable property
In my ASP.NET Core 6 Web API project, I have a FolderDto type that has a nullable ParentFolder property:
public class FolderDto
{
public string Name { get; set; } = string.Empty;
public string ...