asp.net-core-webapi

ASP.NET Core API - Get 404 on Azure App Service, but works ok on Localhost

拥有回忆 提交于 2021-02-20 15:33:34
问题 I have an ASP.NET Core 2.1 app that I've hosted in an Azure app service. When executed locally I'm able to access the controller. But when I host in an Azure app I receive a 404. Here are the minimal steps to reproduce. In Visual Studio 2017 add a new project. Select ASP.NET Core Web Application. Select ASP.NET Core 2.1, API project template, no authentication, configure for HTTPS. Run the new app as a self hosted (not using IIS). Browse to https://localhost:5001/api/values. I get the

ASP.NET Core API - Get 404 on Azure App Service, but works ok on Localhost

佐手、 提交于 2021-02-20 15:29:58
问题 I have an ASP.NET Core 2.1 app that I've hosted in an Azure app service. When executed locally I'm able to access the controller. But when I host in an Azure app I receive a 404. Here are the minimal steps to reproduce. In Visual Studio 2017 add a new project. Select ASP.NET Core Web Application. Select ASP.NET Core 2.1, API project template, no authentication, configure for HTTPS. Run the new app as a self hosted (not using IIS). Browse to https://localhost:5001/api/values. I get the

Actions require unique method/path combination for Swagger

有些话、适合烂在心里 提交于 2021-02-20 06:32:03
问题 I have 2 HTTP GET method in same controller and give me this error HTTP method "GET" & path "api/DataStore" overloaded by actions - DPK.HostApi.Controllers.DataStoreController.GetByIdAsync (DPK.HostApi),DPK.HostApi.Controllers.DataStoreController.GetAllAsync (DPK.HostApi). Actions require unique method/path combination for Swagger 2.0. My Controller : [Route("api/[controller]")] [ApiController] public class DataStoreController : ApiControllerBase { private readonly IDataStoreService

Actions require unique method/path combination for Swagger

和自甴很熟 提交于 2021-02-20 06:30:24
问题 I have 2 HTTP GET method in same controller and give me this error HTTP method "GET" & path "api/DataStore" overloaded by actions - DPK.HostApi.Controllers.DataStoreController.GetByIdAsync (DPK.HostApi),DPK.HostApi.Controllers.DataStoreController.GetAllAsync (DPK.HostApi). Actions require unique method/path combination for Swagger 2.0. My Controller : [Route("api/[controller]")] [ApiController] public class DataStoreController : ApiControllerBase { private readonly IDataStoreService

“500 - Internal server error” when calling ASP .Net Core 2.1 Web API on Windows Server

守給你的承諾、 提交于 2021-02-19 04:32:38
问题 I have an ASP .Net Core 2.1 Web API which I've deployed to a new server we recently purchased (running Windows Server 2016 Standard). The API works perfectly on both my development PC and our old server (running Windows Server 2012 R2). But on this new server, I get this error: 500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed. I remember a year ago also struggling a lot trying to get it to run on our old server. I did eventually

IdentityServer4 implementation with React SPA and Asp.net Core backend

旧巷老猫 提交于 2021-02-18 18:01:43
问题 We have asp.net core (v3.0) Web API backend(no auth yet). A frontend is going to be a SPA( React ). A frontend basically will be an admin panel, it means the website's home page should be just the login page. We are planning on using IdentityServer4 for auth(separate project). If we create the IdentityServer4 project( MVC ) it will have its own login form/page. Since opening our client website(react) login form should be opened, popout and iframe is not the way we are considering to use, what

Azure AAD - The audience is invalid

萝らか妹 提交于 2021-02-17 19:21:12
问题 I have create a webapi secured with azure active directory. I need to test this now and trying to use fiddler with an authorization header. I am trying to generate the token with below code. Target obj = (Target)cmbTarget.SelectedItem; AuthenticationResult authenticationResult; string aadInstance = obj.AADInstance; // "https://login.windows.net/{0}"; string tenant = obj.Tenant; //"rudderless.onmicrosoft.com"; string apiResourceId = obj.ApiResourceId; //"15b4ac7f-23a8-4958-96a5-64159254690d";

Azure AAD - The audience is invalid

好久不见. 提交于 2021-02-17 19:20:10
问题 I have create a webapi secured with azure active directory. I need to test this now and trying to use fiddler with an authorization header. I am trying to generate the token with below code. Target obj = (Target)cmbTarget.SelectedItem; AuthenticationResult authenticationResult; string aadInstance = obj.AADInstance; // "https://login.windows.net/{0}"; string tenant = obj.Tenant; //"rudderless.onmicrosoft.com"; string apiResourceId = obj.ApiResourceId; //"15b4ac7f-23a8-4958-96a5-64159254690d";

CORS Policy has been blocked my subdomain

喜你入骨 提交于 2021-02-17 05:37:28
问题 I have a same domain, one of them is domain without prefix www. For example, https://www.example.com https://example.com First domain works fine because it is default domain. But second one has gives error when I do CRUD or accessing any api service. Access to XMLHttpRequest at 'https://www.example.com/hubCon/negotiate' from origin 'https://example.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow

CORS Policy has been blocked my subdomain

99封情书 提交于 2021-02-17 05:37:08
问题 I have a same domain, one of them is domain without prefix www. For example, https://www.example.com https://example.com First domain works fine because it is default domain. But second one has gives error when I do CRUD or accessing any api service. Access to XMLHttpRequest at 'https://www.example.com/hubCon/negotiate' from origin 'https://example.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow