Questions tagged [asp.net-core-webapi]
Questions about ASP.NET Core web APIs and web apps that are not dependent on MVC Views or Razor Pages
asp.net-core-webapi
9,286
questions
1
vote
0
answers
22
views
Unable to get non default method from the controller in ASP.NET Core 8 with Angular frontend
I am using ASP.NET Core 8.0 with Angular v17+ frontend. I can only get my default get method from the controller but not my other one.
My controller looks like this:
[Route("api/values")]
[...
0
votes
1
answer
17
views
Google OAuth 2.0 integration in ASP.NET Core Web API project in C#
I'm getting the error when trying to log in with google .
Microsoft.AspNetCore.Authentication.AuthenticationFailureException: An error was encountered while handling the remote login.
---> ...
0
votes
0
answers
23
views
Deploying an ASP.NET Core 8.0 Web API
I am a newbie in ASP.NET. I have an ASP.NET Core 8.0 Web API. The application is to be published. On the production system (Windows) .NET Core Hosting Bundle is installed. An Apache server serves as a ...
0
votes
0
answers
13
views
MSAL and JWT, how to handle multiple audiences either at client or server?
I'm struggling with communicating 2 .NET Core APIs which use Azure AD (Entra) to authenticate the JWT bearers from the requests they receive. In particular, I'm trying to use the approach described in ...
0
votes
0
answers
28
views
Setting ASPNETCORE_ENVIRONMENT variable from launchSettings.json of DockerCompose project only
Problem Statement
I am currently working on an ASP.NET Core 8.0 Web API backend solution with multiple projects that runs using docker-compose in Visual Studio 2022. I have defined several profiles in ...
1
vote
1
answer
45
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 ...
1
vote
0
answers
12
views
Azure Signal R - Not acting as backplane as expected - cannot send message to specific user if not connected to same server
So we implemented Signal R on ASP.NET Core and used single server at first due to limitations with scaling
using default scenario not serverless
We discussed on implementing backplane or using Azure ...
-1
votes
0
answers
15
views
Why does POST not change the source code in my project? Using Visual Studio to edit, and ASP.NET Core Web API
Why does POST not change the source code in my project? Using Visual Studio to edit, and ASP.NET Core Web API.
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
namespace CountryAPI....
0
votes
1
answer
34
views
How to bind json data to FromBody Dto in ASP.NET Core Web API?
In my ASP.NET Core Web API, when I call a method that is a HttpPost and receives a DTO object in FromBody, and sends extra fields that are not in SourceUrlDto, I fail during binding on the code side.
...
0
votes
0
answers
22
views
Steam Open Id ASP.NET Core cookie not found error
I am developing a Web API application, I want to enable authorization via steam.
After logging in on the site, I get an error:
statusCode: 500
An error was encountered while handling the remote login
...
0
votes
0
answers
13
views
how to give back camera access in blazor webassembly
I Developed web application using blazor web assembly, asp.net core, and JavaScript functions, as of now I gave front camera access , now I want to give a back camera access also.
Steps along with ...
0
votes
1
answer
31
views
API cannot see Website middleware assignments to HTTPRequest
I am trying to understand why the API cannot see what assignments I am making in the middleware of the Website.
public async Task InvokeAsync(HttpContext httpContext) { try { ...
0
votes
1
answer
28
views
How to run multiple ASP.NET Core projects at the same time in VS Code?
I have 2 types of .NET projects, 1st is ASP.NET Core Web API (for backend) and the second is a Blazor WASM (for frontend).
Is it possible to configure these two projects to run at the same time using ...
0
votes
1
answer
35
views
How replace OneOf to AnyOf in swagger generation
I have a c# code that generates swagger
services.AddSwaggerGen(options =>
{
options.UseOneOfForPolymorphism();
options.SelectDiscriminatorNameUsing(_ => "messageType&...
0
votes
1
answer
40
views
ASP.NET Core Web API : entity doesn't get saved to database
I am creating a basic ASP.NET Core Web API which contains a list of countries/locations/places of interest.
I have created all the methods for location which are a child of the country object and ...