Posts

Showing posts from October, 2020

Disable json serialization naming policy in asp.net core

In Startup.cs add yellow highlighted code: public void ConfigureServices(IServiceCollection services)         {             services.AddAuthentication(IISDefaults.AuthenticationScheme);             services.AddCors();             services.AddControllers().AddJsonOptions(jsonOptions =>             {                 jsonOptions.JsonSerializerOptions.PropertyNamingPolicy = null;             });  

Hosting api locally on IIS for development

Image
 https://wakeupandcode.com/iis-hosting-for-asp-net-core-3-1-web-apps/ https://stackify.com/how-to-deploy-asp-net-core-to-iis/ https://medium.com/@aram161287/deploy-asp-net-core-web-api-on-iis-f75e755a6402 Check if  aspnetcoremodulev2 module is installed in IIS as below. If not, then install it. Create IIS profile in your .NET core project as below: Create Application pool as below: Create new website as below. Disable anonymous authentication and enable windows authentication for the created website. Check below settings in launchSettings.json. The url and binding should match the IIS hosted website. "iisSettings": {     "windowsAuthentication": true,     "anonymousAuthentication": false,     "iis": {       "applicationUrl": "http://localhost:5100/",       "sslPort": 0     },