Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Web Application edit source while running like in Tomcat\Eclipse\Java

In an ASP.NET Web Site project, I've always been able to make changes to the underlying C# code and simply refresh the page in the browser and my changes would be there instantly.

I can do the same thing when working with Java and Eclipse - edit my Java source and refresh the page and my changes are there.

I cannot do this in ASP.NET MVC though and it is a real downer - I have to stop the running process and make my changes, and then restart debugging. This is a huge waste of time.

Am I doing it wrong? What is the best approach to ASP.NET MVC development?

like image 484
Bryan Migliorisi Avatar asked Feb 19 '10 02:02

Bryan Migliorisi


2 Answers

I rarely use debug mode in ASP.NET MVC project (F5). I run the project once with CTRL+F5 and always have a browser window open. Then if I make a change to a view (.aspx, .ascx), I hit F5 in the browser and changes automatically take effect. If I have to do changes in the .NET code (controller logic, models, repositories, etc...) I no longer use the browser. To verify that my change is correct I navigate to the corresponding unit test and hit CTRL+R+T. The result is seen either in green or red.

like image 124
Darin Dimitrov Avatar answered Oct 06 '22 00:10

Darin Dimitrov


You don't have to stop the process, you can break.

Try breaking the project, then editing, then continue.

1) CTRL-ALT-BREAK 2) Edit your code 3) F5

like image 23
codenheim Avatar answered Oct 06 '22 00:10

codenheim