在ASP.NET vNext,为什么是code不重新编译就飞? [英] In ASP.NET vNext, why is code not recompiled on the fly?

查看:178
本文介绍了在ASP.NET vNext,为什么是code不重新编译就飞?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从用k网络命令行HelloMvc示例应用程序。我曾尝试使用KVM使用-runtime使用可用的不同的环境给我来运行它。当我更改控制器,并在浏览器中按F5键(或Ctrl + F5),在code不会自动重新编译和页面不会改变。我究竟做错了什么?

 活动版本运行时体系结构
------ ------- ------- ------------
       1.0.0-素α3svr50 86
       1.0.0-素α3svrc50 86
       1.0.0-alpha4 CLR 86
  * 1.0.0-alpha4 CoreCLR 86
 

解决方案

运行 DNX网站从您的命令行只启动主机。要获得自动重新编译善良的东西需要看文件的变化,如果检测到任何变化重新启动主机。要做到这一点使用 - 看标记和运行Web命令是这样的:

  DNX --watch网
 

目前这只是关闭主机检测到变化时,所以你需要的东西,重新启动它一旦出现这种情况。如果您运行从Visual Studio 14的项目IISEx preSS为您完成此

您最佳的Visual Studio之外的本工作的办法是通过一个JavaScript构建工具或NPM脚本。我建议你​​看看这一口,ASPNET-K插件(注意这个插件只适用于Windows目前),如果你想在文件的改变不断重新编译工作时VS14之外。似乎是要完成,如果没有,我已经找到IISEx preSS的最佳途径。这个插件是/是特定的Windows,而是着眼于code应该让你开始。 :)

格伦F.亨里克森写了一个包装nodemon,这是非常不错的,叫kmon。尝试了这一点为好。 的kmon GitHub的资源库拥有所有你需要

的说明

I am running the HelloMvc sample application from the command line using k web. I have tried to run it using the different environments available to me using kvm use -runtime. When I change the controller and hit F5 (or Ctrl+F5) in the browser, the code is not recompiled automatically and the page does not change. What am I doing wrong?

    Active Version      Runtime Architecture                         
------ -------      ------- ------------ 
       1.0.0-alpha3 svr50   x86          
       1.0.0-alpha3 svrc50  x86          
       1.0.0-alpha4 CLR     x86          
  *    1.0.0-alpha4 CoreCLR x86

解决方案

Running dnx web from your command line only starts your host. To get the automatic recompilation goodness something needs to watch the files for changes and restart your host if any changes are detected. To accomplish this use the --watch flag and run your web command like this:

dnx --watch web

Currently this just shuts down your host when a change is detected, so you need something that restarts it once that happens. IISExpress does this for you if you run your project from Visual Studio 14.

Your best bet for this workflow outside of Visual Studio is through a JavaScript build tool or npm scripts. I would recommend you to look into this gulp-aspnet-k plugin (note this plugin only works on windows currently) if you want continuous recompilation on file changes while working outside of VS14. Seems to be the best way to accomplish that without IISExpress that I have found. This plugin is/was windows specific, but looking at the code should get you started. :)

Glenn F. Henriksen has written a wrapper for nodemon that is very nice, called kmon. Try that out as well. The kmon GitHub repository has all the instructions you need

这篇关于在ASP.NET vNext,为什么是code不重新编译就飞?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆