Category : asp.net-core

I have an Angular and.NetCore app that I am deploying to Azure App Service (Windows). I use Azure Pipelines, here is my pipeline configuration Pipeline Config When I deploy to app service this is my folder structure. Whole App Service This is inside my ClientApp folder. ClientApp Folder I get this error, I have been ..

Read more

I have the following .net-core controller: using CadastroDerivativos.Domain.Entities.EquityOpt; using CadastroDerivativos.Domain.Interfaces.Services; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; namespace CadastroDerivativos.WebApiAngular.Controllers { [Route("api/[controller]")] [ApiController] public class EquityOptController : ControllerBase { private readonly IEquityOptService _equityOptService; public EquityOptController(IEquityOptService equityOptService) { _equityOptService = equityOptService; } [HttpGet] public ActionResult<IEnumerable<EquityOptions>> GetEquityOpt() { return Ok(_equityOptService.GetEquityOpts()); } } } and the following angular component and interface: import ..

Read more

I’m getting the issue data.slice is not a function in Angular. Before searching the help here, I’ve looked through similar issues, but the problem is still not been solved. So, I have a component.ts class: export class SportsmenListComponent implements OnInit { userDetails: any; spd: any; users: User[]= []; displayedColumns: string[] = [‘Id’, ‘Name’, ‘Surname’, ‘BirthDate’, ..

Read more

in asp.net core and angular project, I’m trying upload image where I’m want get image path in object as parameter in HttpPost method ,but I get this error. HttpErrorResponse error: "{"errors":{"fileNationalId":["Error converting value "C:fakepathFoodBankIcon.png" to type ‘Microsoft.AspNetCore.Http.IFormFile’. Path ‘fileNationalId’, line 1, position 410."]}, this is my model public class EmployeeModel { //…… [NotMapped] public IFormFile ..

Read more

I set up my project on ASP.NET Core 5 and Angular 10. I try to publish app with Docker Here is the github of this project (branch "prod") https://github.com/TheLamed/Khrystyna-Kvyk Here is my dockerfile: FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base WORKDIR /app EXPOSE 80 EXPOSE 443 FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build WORKDIR /src COPY ["KhrystynaKvyk.Web.csproj", "KhrystynaKvyk.Web/"] COPY . "KhrystynaKvyk.Web/" ..

Read more

I have an Angular based frontend and ASP.NET Core 3 based APIs. I want to send custom variable in each of API request and read it in API but I’m getting this error: Cross-Origin Resource Sharing error : HeaderDisallowedByPreflightResponse On ASP.NET side, I added this setting: public void ConfigureServices(IServiceCollection services) { services.AddCors(options => { options.AddDefaultPolicy( ..

Read more