Sending a form POST HTTP request (Content-Type: application/x-www-form-urlencoded) to the below controller results into a HTTP 415 Unsupported Media Type response. public class MyController : Controller { [HttpPost] public...
Not sure what am I missing here but I am not able to get the values from my appsettings.json in my .net core application. I have my appsettings.json as:...
What I am trying to do I have a backend ASP.Net Core Web API hosted on an Azure Free Plan (Source Code: https://github.com/killerrin/Portfolio-Backend). I also have a Client Website...
I have an ASP.NET core project and I’m getting this error when I try to build it: error TS18003: Build:No inputs were found in config file 'Z:/Projects/client/ZV/src/ZV/Scripts/tsconfig.json'. Specified 'include'...
In appsettings.json { "MyArray": [ "str1", "str2", "str3" ] } In Startup.cs public void ConfigureServices(IServiceCollection services) { services.AddSingleton<IConfiguration>(Configuration); } In HomeController public class HomeController : Controller { private readonly...
How do I get the Development/Staging/production Hosting Environment in the ConfigureServices method in Startup? public void ConfigureServices(IServiceCollection services) { // Which environment are we running under? } The ConfigureServices...
Can you please let me know how to get client IP address in ASP.NET when using MVC 6. Request.ServerVariables...
When using WebHostBuilder in a Main entry-point, how can I specify the port it binds to? By default it uses 5000. Note that this question is specific to the...
When I run PM> Remove-Migration -context BloggingContext in VS2015 with an ASP.NET Core project using EF Core I get the following error: System.InvalidOperationException: The migration '20160703192724_MyFirstMigration' has already been...
I’m relatively new at .NET, and I decided to tackle .NET Core instead of learning the “old ways”. I found a detailed article about setting up AutoMapper for .NET...