How to watch for file changes “dotnet watch” with Visual Studio ASP.NET Core

If you want to use ASP.NET 2.x or 3.x you need to change it a bit. The watch tool is a global tool now and you don’t need to add it as a reference any longer The syntax is slightly different “Watch”: { “executablePath”: “dotnet.exe”, “workingDirectory”: “$(ProjectDir)”, “commandLineArgs”: “watch run”, “launchBrowser”: true, “launchUrl”: “http://localhost:5000/”, “environmentVariables”: … Read more

Remove “Server” header from ASP.NET Core 2.1 application

This solution works on IIS 10+ version and allows to remove x-powered-by and server headers in server response. In IIS 10 a new attribute was added: removeServerHeader. We need to create web.config file in asp.net core application with following content: <?xml version=”1.0″ encoding=”utf-8″?> <configuration> <system.webServer> <security> <requestFiltering removeServerHeader=”true” /> </security> <httpProtocol> <customHeaders> <remove name=”X-Powered-By” /> … Read more

Is Kestrel using a single thread for processing requests like Node.js?

Updated for ASP.Net Core 2.0. As pointed by poke, the server has been split between hosting and transport, where libuv belongs to the transport layer. The libuv ThreadCount has been moved to its own LibuvTransportOptions and they are set separately in your web host builder with the UseLibuv() ext method: If you check the LibuvTransportOptions … Read more

How do I get the kestrel web server to listen to non-localhost requests?

The default configuration file used by Kestrel server is hosting.json. The name was changed multiple times in different beta versions. If you use now project.json with the following “command” section “commands”: { “web”: “Microsoft.AspNet.Server.Kestrel” } then during starting the server from the command line by dnx web the file hosting.json will be read. The file … Read more