kaivalya
kaivalya

Reputation: 3869

MVC compile setting

After making any change on controllers I have to rebuild for the changes to be effective. Is there a way to set the application that I don't have to build for code file changes?

Upvotes: 0

Views: 104

Answers (2)

Dan Atkinson
Dan Atkinson

Reputation: 11689

As Adrian has already said, it's not possible, but there is something you could do to possibly speed up the time it takes to compile...

If your application is quite large, consider unchecking some of your seldom changed solutions (and FXCop StyleCop QC solutions, if you use them). I find that, when I'm only working on my MVC project, I uncheck my other layers to save time.

You can choose which projects to compile by doing the following:

  1. In the solution explorer in VS, right click the solution at the top of the tree and choose "Properties"
  2. In the newly opened box, on the left, choose "Configuration Properties".
  3. Now uncheck any unneeded projects to prevent them from being compiled.

Now rebuild.

Also, if you have a pre/post build scripts that are best left for deployment, consider removing/moving them during development.

Upvotes: 1

Adrian Godong
Adrian Godong

Reputation: 8911

No, there is no way to do that. Controllers in .NET is a compiled binary, which means, it has to be compiled first before it can be used.

Of course, you are not required to build if you just want to run the application. Keep in mind you won't see the latest changes.

Upvotes: 2

Related Questions