johnny
johnny

Reputation: 19735

On an ASP.NET 4.x MVC application, if I make a minor change, do I have to recompile everything?

Not sure I'm using the right terminology, but if I have a website, and I make a change to one of the files, the underlying logic C#, whatever, do I have compile the whole application again before I deploy it?

How do I publish a small change?

Upvotes: 0

Views: 112

Answers (2)

Erik Funkenbusch
Erik Funkenbusch

Reputation: 93424

You keep saying "the whole thing", but you don't really seem to understand what that means.

An MVC application is a Web Application project, which means that it's class files are compiled into an assembly. When you make a change to a class, the assembly that it's in must be recompiled (as well as any assemblies that are dependent upon it) and redeployed.

You don't have to recompile other assemblies that have not been changed, and you don't have to redeploy any unchanged files (like views or css or javascript).

If you have 100 pages, chances are, you probably going to split that up into several assemblies anyways. But even if you don't, it really doesn't take very long to compile even a 100 page web application (the pages themselves do not get compiled, it's only the .cs files). At most this should take 15-20 seconds on a medium powered workstation.

I think you're worrying about something that isn't really that big of a deal. You're probably more concerned about redeploying, but if you setup your publish system correctly, this is a single click, 10 second thing.

Upvotes: 3

Kyle Trauberman
Kyle Trauberman

Reputation: 25684

That depends on where you made the change.

If you made the change in a .cshtml or similar view file, or other content file (like javascript, css, images, etc.), just uploading the updated file will be sufficient.

If you changed a .cs (or vb, etc.) class however, you will need to recompile.

Upvotes: 1

Related Questions