views:

113

answers:

1

Hi

I'm developping based on a API of a .net CMS.

Now I create my own class with some code.

Whenever i re upload my class... it takes so long for recompiling or reloading the website.

Is it possible to prevent compiling the other basic classes which I have not touched and not reuploaded and just the new uploaded?

Thank you.

+2  A: 

.NET is compiled language so you cannot "compile" just some classes. But you can precompile whole site after you add some files, that can speed up "cold start", so it would not need to be precompiled on first visit. If you're using "Publish" tool in VS, you can add Post build event which calls precompiler on published location. You will always experience longer start time on first access, you cannot avoid that. At least I don't know how...
Second option is ngen.exe, which will create native image from your IL-based .net managed code, and reduce startup time (on first request, .net will see this native image and just execute it). But with using ngen.exe you are loosing some runtime optimization, because ngen must "play safe", so SSE and similar optimization are not possible. It is recommended to perform performance profiling on using ngen.exe, in some cases app will perform slower!

Hrvoje
Thank you.ok, so I have to create a dll of my class and throw it to bin folder., correct?
snarebold
that's correct. On first request site will be recompiled because new dll, or you can start precompile script on your own.
Hrvoje