Category "asp.net-core"

Create WSDL for an ASP.Net Core ApiController

I am creating a service using ASP.Net Core. The service is based on the ApiController. [ApiController] public class XmlALaCarteServiceController : ControllerBa

Combine Json and file upload in a controller

I'm trying to send a form with Angular to a controller that contains json and a file. [HttpPost("Save", Name = "SaveReportRequest")] public ActionResult<Repo

Serialize Enum as DisplayName or EnumMember Value

I have an enum declared in c#. I have a Display Name/ EnumMember value annotation and Student Class. I'm using asp.net core 2.2+ version with Odata. [DataContra

How to customize all response in .Net Core?

Im using .Net Core to write a json api server, so I need customize all response to like: public class Result { public int Code { get; set; } public stri

How to set the base path or the ApplicationPath for ASP.NET MVC application

I have an ASP.NET MVC web application which I want to put behind NGINX reverse proxy. Currently the web application is served from the domain's root, i.e., http

Setting connection string with username and password in ASP.Core MVC

I am working on my first ASP.NET Core MVC application.What is the right way to specify the connection string in a ASP.NET Core MVC application with a sql server

Can ASP.NET CORE MVC be hosted in Xamarin App(Android)?

I have a ASP.NET CORE MVC (.NET CORE 3.1) application running well on Kestrel in Windows, Now I'm wondering if possible to migrate it to Android via Xamarin? T

IFormFile always return null in asp.net core 2.1

Here's how I upload file my Api action : [HttpPost] public async Task<BaseListResponse<MediaStorageModel>> MediaBrand(IFormFile file, int brandId)

"Error unprotecting the session cookie" exception

i have an Asp.NET MVC application with this Authentication setup: ConfigureServices(): services.AddSession() services.AddAuthentication(sharedOptions => sh

ASP.NET Core 1.1 compiling with C# dynamic Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'

I'm using Visual Studio 2017 RC and started a new ASP.NET Core project targeting the full .NET Framework. This line of code will not compile. dynamic handler

Check that Serilog is configured correctly

In my ASP.NET Core Web API application I have a Serilog set up to log different types of events (Information, Warning etc) into different tables in a SQL Server

Docker - Mongo DB instance not connecting with application

I am using docker mongo with my aspnet core application but I am unable to make connection with mongodb which is running under container. Although I am able to

CompilationFailedException during runtime compilation of Razor from AspNetCore TestHost

I have ASP.Net MVC application, one part of it is compiling razor views to string. The code is very similar to this example: https://long2know.com/2017/08/rend

the type or namespace name 'RuntimeCompilation' does not exist in the namespace 'Microsoft.AspNetCore.Mvc.Razor'

If I write this line of code, services.AddMvc().AddRazorRuntimeCompilation(), in startup.cs and while publishing the project from Visual Studio 2019 on Azure, I

How to load razor page before it's done rendering?

I have a table of records in Index.cshtml, once a user clicks on a record to view the details it will take them to Details.cshtml. The issue is, there is a lot

Showing #value! before enable editing on excel if I write formula using epplus

Using C# .net core I am updating existing excel template with Data and formulas using EPPlus lib 4.5.3.3. If you see the below screen shots all formula cells ha

Microsoft.AspNetCore.OData 8: controller is not found by convention

As described in the docs, Microsoft.AspNetCore.OData 8 uses a convention to tie a controller to an entity set. They also provide a sample that demonstrates this

Best strategy for creating a child container (or isolated scope) with Microsoft.Extensions.DependencyInjection

In my AspNetCore application, I process messages that arrive from a queue. In order to process a message, I need to resolve some services. Some of those service

Confirm popup working fine but not delete the item in .net core

public async TaskOnPostDelete(int Id) { var book= await _db.Book.FindAsync(Id); if(book == null) { return NotFoun

SignalR: Cancellation in Case of Client to Server Streaming makes code buggy in case of dotnet client

I’m trying to send a stream from client to server from a dotnet client to another dotnet server through sending an invocation to a method on server hub as