kestrel-http-server

Running first ASP.NET 5 application using VSCode, DNX and kestrel results in IOException

≡放荡痞女 提交于 2019-12-05 12:04:30
问题 Following the steps described in the Visual Studio Code documentation, running the final command dnx . kestrel via the Command Palette of VSCode on Mac OS X results in an IOException when visiting http://localhost:5001: kqueue() FileSystemWatcher has reached the maximum nunmber of files to watch. See the attached screenshot for the complete stacktrace. What could be wrong? 回答1: It's a known mono bug. In order to fix it set the MONO_MANAGED_WATCHER environment variable: export MONO_MANAGED

Determine port Kestrel binded to

我是研究僧i 提交于 2019-12-05 06:13:46
I'm writing a simple ASP.NET Core service using ASP.NET Core empty ( web ) template. By default, it binds to port 5000 but I would like it to bind to a random available port on the system. I can do so by modifying BuildWebHost to: public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>() .UseUrls("http://*:0") // This enables binding to random port .Build(); It binds to a random port but how do I determine from within the application which port I'm listening to? Hosting addresses of ASP.NET Core application could be accessed via

Stop a running dotnet core website running on kestrel

房东的猫 提交于 2019-12-05 00:31:26
When deploying a new version of an existing .net core website. How do I first safely stop the old running kestrel app? Here is an exmaple of what I would like to write (Pseudo deployment script): dotnet stop mysite/mysite.dll <---- this line here mv mysite/ mysite.bak/ cp newly-published-mysite/ mysite/ dotnet run mysite/mysite.dll killall dotnet seems a little unsafe. How would it work if I were hosting two small sites on one box? Ilya Chumakov Accordingly to this discussion , there is no safe way to stop Kestrel now. You need to find a PID by name of your dll and kill it : kill $(ps aux |

Setting index.html as default page in asp.net core

拈花ヽ惹草 提交于 2019-12-04 09:55:34
问题 How can I get asp.net core to serve an index.html file from inside my wwwroot? The reason I want to do this is because I an developing an angular 4 app using the angular CLI and it takes care of the entire build process. I have set it up to build into the wwwroot directory of my asp.net core project but asp.net core doesn't want to serve it. At first I tried to return the html file through a controller. I tried this route: app.UseMvc(routes => { routes.MapRoute( name: "default", template: "

Recycle of App Pool kills Kestrel but does not restart

泄露秘密 提交于 2019-12-04 09:07:01
Background When hosting a (non-Core) ASP.net site on IIS 8+ it is possible to utilize the IIS Application Initialization Module to pro-actively initialize ('warm-up') a web application when IIS starts up (or, I believe, when an app pool is recycled). As far as I know, this is not possible when hosting a .net Core app on IIS. I have also noticed that when hosting a .net Core (1.1) app on IIS, the dotnet.exe process (Kestrel) is killed as part of an application pool recycle event. This process is then only restarted when the first new request is made. I'm asking the below questions because I am

To which process should I attach Visual Studio Debugger to debug a Kestrel application?

ⅰ亾dé卋堺 提交于 2019-12-04 05:50:45
I am bringing up command line and running my app using dotnet run command. This starts Kestrel and brings up my application. How should I go with identify to which process to attach debugger so I can debug the website that Kestrel now hosts? I specifically need to be able to do it this way - meaning I can't use standard F5. Unfortunately, there is no way to tell right now using the tools provided by Visual Studio or .NET Core. Notice, though, that the community has already requested for this feature here , so you can voice your opinion there. Currently, the best option is to follow the steps

How to determine which port ASP.NET Core 2 is listening on when a dynamic port (0) was specified

拥有回忆 提交于 2019-12-04 05:50:27
I've got an ASP.NET Core 2.0 app which I intend to run as a stand-alone application. The app should start up and bind to an available port. To achieve this I configure the WebHostBuilder to listen on " http://127.0.0.1:0 " and to use the Kestrel server. Once the web host starts listening I want to save the url with the actual port in a file. I want to do this as early as possible, since another application will read the file to interact with my app. How can I determine the port the web host is listening on? You can achive it in Startup class in method Configure. You can get port from

Why does ASP.NET 5 on Linux require kestrel?

痴心易碎 提交于 2019-12-04 02:49:36
I am trying to understand the entire web/framework/application stack when installing ASP.NET 5 on Linux. All the instructions I have read, including this one haven't really answered my question: Why can't Nginx server work without Kestrel like here: http://www.mono-project.com/docs/web/fastcgi/nginx/ ? Or am I way off. I'm trying to understand what the reason is for this structure: .NET Core(or mono) --> Kestrel --> Nginx Isn't Kestrel just another web server like Nginx but with a lot less features? ASP.NET Core (ASP.Net 5) doesn't require Kestrel ! You're right, Kestrel is just a simple HTTP

Visual Studio keeps adding IIS Express back into my launchsettings.json

我们两清 提交于 2019-12-04 00:51:10
I am trying to remove the IIS Express profile from my .NET Core launch settings but every time i repoen the solution, Visual Studio adds it back in again. For example, in a new project my launch settings looks like this { "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:55735/", "sslPort": 0 } }, "profiles": { "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, "MyProject": { "commandName": "Project", "launchUrl": "http:/

ASP.Net Core application service only listening to Port 5000 on Ubuntu

那年仲夏 提交于 2019-12-03 15:35:55
I am trying to host an ASP.Net Core MVC application (https redirection is enabled) on Ubuntu server, using Nginx as a reverse proxy. I have created and installed a local SSL certificate using OpenSSL. When i run my application using dotnet CLI it listens on both http://localhost:5000 & https://localhost:5001 , and i am able to access it on web using https (http requests are being redirect to https by Nginx). The problem is when i try to run the as a service, it only listens on http://localhost:5000 . Here's the *.service file : [Unit] Description=Test ASP.Net core web application service.