1

I'm trying to host a web application created in VS 2015 Preview with Asp.Net 5 Starter Web. I set Debug target to Web, I hit F5 and klr console is starting and and I am able to load application in browser, at specified port.

The problem is, when I change something in code (in a controller, or even in a cshtml view) and save, the klr server stops and console closes. Is this the intended behavior? Or should I be able to save and refresh, as Roslyn compiler works?

user3473830
  • 7,165
  • 5
  • 36
  • 52
Ion Robu
  • 59
  • 4
  • I guess Roslyn main thing is to do code analysis while you expect build refresh. What you are getting is intended behaviour as per my understanding. – Amit Dec 17 '14 at 09:36
  • http://stackoverflow.com/questions/23984030/how-will-roslyn-help-me-in-avoiding-a-recompile-to-deploy-changes-to-my-asp-net - Hanselman says that Roslyn should do that in next vNext version. Possibly not in this beta version. My main problem is that I also cannot host my app in IIS neither as it have to be published (http://stackoverflow.com/questions/27325264/asp-net-5-project-hosting-on-iis/27330403#27330403), so I have to stop it, build it and start it again, anytime I make a change, and this is very uncomfortable. Do you have any solution to run ASP.NET 5 application while you develop it? – Ion Robu Dec 17 '14 at 13:04
  • I'm not sure but I'm afraid you have to work with IIS Express to get the "save and refresh" work for you. I think that's the default way when you create an asp.net 5 project in VS 2015 preview. – Ricky Dec 18 '14 at 05:42

1 Answers1

2

Ok, here is how I managed it:

  1. Installed KVM (http://www.tugberkugurlu.com/archive/getting-started-with-asp-net-vnext-by-setting-up-the-environment-from-scratch)
  2. Added "nodemon": "1.2.1" to package.json and restored nodemon package
  3. Opened cmd, go to app directory and type nodemon --exec "K.cmd web" -e cs,json (-e tells nodemon which type of files to watch - I don't want all kind of files, since js, css etc are reloaded on refresh anyway).

    X:\Support\AspNet5\Test>nodemon --exec "K.cmd web" -e cs,json

    18 Dec 14:57:25 - [nodemon] v1.2.1

    18 Dec 14:57:25 - [nodemon] to restart at any time, enter rs

    18 Dec 14:57:25 - [nodemon] watching: .

    18 Dec 14:57:25 - [nodemon] starting K.cmd web

    [INFORMATION:Microsoft.AspNet.Server.WebListener.MessagePump] Start

    Started

  4. Edit a cs file - looking back to cmd window

    18 Dec 14:59:40 - [nodemon] restarting due to changes...

    [INFORMATION:Microsoft.AspNet.Server.WebListener.MessagePump] Stop

    18 Dec 14:59:41 - [nodemon] starting K.cmd web

    [INFORMATION:Microsoft.AspNet.Server.WebListener.MessagePump] Start

    Started

  5. Refresh the browser

Hope this helps

Ion Robu
  • 59
  • 4