如何在项目运行时在Visual Studio中添加或重命名文件?

时间:2023-01-16 16:06:01

How can I add or rename files in Visual Studio while the project is running? I am currently developing a ASP.NET 5 web application and I continuously need new TypeScript files or html files. It is a pain to always have to stop and start the project again.

如何在项目运行时在Visual Studio中添加或重命名文件?我目前正在开发ASP.NET 5 Web应用程序,我不断需要新的TypeScript文件或html文件。总是不得不再次停止和启动项目是一件痛苦的事。

I have a gulp watcher running that copies all html changes and compiles all TypeScript files into one app.js towards wwwroot.

我有一个gulp观察者运行,复制所有的HTML更改,并将所有TypeScript文件编译成一个app.js向wwwroot。

1 个解决方案

#1


0  

You can do this, you just need run through a few steps first.

你可以这样做,你只需要先完成几个步骤。

  1. Run your local site but bypass debug mode (CTRL + F5). Debug mode requires recompilation to pickup file modifications since the debugger isn't attached to the process.

    运行本地站点但绕过调试模式(CTRL + F5)。调试模式需要重新编译以获取文件修改,因为调试器未附加到进程。

  2. Install dnx-watch by running this command dnu commands install Microsoft.Dnx.Watcher. This will add file change monitoring to your project. This is new as of beta8, you can read about it here.

    通过运行此命令安装dnx-watch dnu命令install Microsoft.Dnx.Watcher。这将为您的项目添加文件更改监视。这是beta8的新功能,你可以在这里阅读它。

#1


0  

You can do this, you just need run through a few steps first.

你可以这样做,你只需要先完成几个步骤。

  1. Run your local site but bypass debug mode (CTRL + F5). Debug mode requires recompilation to pickup file modifications since the debugger isn't attached to the process.

    运行本地站点但绕过调试模式(CTRL + F5)。调试模式需要重新编译以获取文件修改,因为调试器未附加到进程。

  2. Install dnx-watch by running this command dnu commands install Microsoft.Dnx.Watcher. This will add file change monitoring to your project. This is new as of beta8, you can read about it here.

    通过运行此命令安装dnx-watch dnu命令install Microsoft.Dnx.Watcher。这将为您的项目添加文件更改监视。这是beta8的新功能,你可以在这里阅读它。