What Conditions Cause a Web Application to Be Just In Time Compiled? - asp.net

I'm curious as to the exact conditions that cause an application to be Just In-Time Compiled?
I think we all know the first visit to a non pre-compiled site will cause a JIT.
What about throwing new code into the App_Code directory?
I'm pretty sure some actions like saving the web.config simply cause the cause the Application Pool to unload and so far I'm a little confused as to which action has which result.
I'd love to get a link to some good MS documentation or failing that the thoughts of an ASP.NET all star.
Thanks in advance!

Understanding ASP.NET Dynamic Compilation
ASP.NET Application Life Cycle Overview for IIS 5.0 and 6.0, section "Compilation Life Cycle"

Related

Classic ASP and ASP.NET MVC2 Integration

I have inherited a Classic ASP application with a Delphi COM layer. I am tasked with migrating the app to ASP.NET MVC2 and C# with web services replacing the Delphi. Due to the amount of users of the application and the fact that I'm the third developer this company has hired to do this, the company would like to migrate sections at a time. That leaves us with a mixed hybrid of Classic ASP and ASP.NET MVC2 sections. My guys and I have built the first section of the app and are ready for integrating the apples and oranges. My question is, has anyone done this? If so, how? The first attempt is creating a sub-folder in the classic app and inserting the MVC stuff into there. Doing it this way, I cannot get any urls to work. It's probably some ignorance in the MVC pathing but if anyone has any tips at all on this, combining ASP and MVC2 I would love some help.
Thanks and I apologize if this is a bit vague, I'd really just like to start a conversation or connect with someone that's done this before.
First, you need to make the subfolder in the classic app a Virtual Directory or Wep Application for MVC to work, it wont work simply dropped in a subfolder of an IIS website.
Second, if the app is authenticated, you need to figure out a way to share the authuthentication so users don't have to login every time they switch sections of the app. (Unless thats an acceptable situation, which I doubt). Sharing this authentication may involve making some changes to the existing application, or possibly not.
I wonder what is the scope of this project and why it cannot be done in one felswoop? I'm not saying doing it in phases is bad, but if that is a requirement, you'll need to address the above issues.
I think that much better way is rewrite app to MVC from scratch. No step-by-step, no mixing. It will save you a lot of pain and also it will take much less time to do, even it doesn't seem so at first sight.

Can .asp & .aspx pages work if placed in same virtual directory?

Can .asp & .aspx pages work if placed in same virtual directory?
Short answer is YES and I have used such configuration in past.
Long answer is there are unlikely chances of having trouble - essentially, both ASP and ASP.NET will run within same application pool and hence same worker process and there can be issues related to the same. For example, ASP page is using COM components written .NET version higher (or different) than ASP.NET version that you are using and ASP.NET code gets triggered earlier loading CLR with lower version within process - which may cause an issue for .NET code for COM components.
The best way is to try it and test it to reasonable extent.

Asp.Net 4.0 Profiling on IIS7

New to both Asp.Net 4.0 and IIS7 deployment.
I am having a runtime problem with my application. Basically certain pages are not loading, also looks like a memory issue related to certain calls etc.
What are some of the tools and techniques for profiling/debugging Asp.net 4.0 when deployed on iis7. I am just looking for a way to get the BIG picture and the drill down to smaller level.
Is it suggested that any profiling of value take place in VS2010?
You can use iis7 failed request logs to track which handler is causing pages to fail out. Using this approach, you can narrow down where the issue is happening, and then use asp.net page level tracking and exception stack traces in your event log to solve the problem. Also, good logging in your global.asax application_error method is always recommended.

Detecting Changes in an ASP.NET Web Site

The ASP.NET framework does a very good job of detecting when a file has changed and recompiling that file etc. I would like to be able to hook into that update process. Is this at all possible?
I might want to do this as part of an initiative to try and version web sites developed as Web Site projects, versus Web Applications, where the version is easily found in statically deployed assemblies. If I my be misdirecting my energies as there are already better way if versioning web sites, I'd still appreciate some pointers.
I don't know if you can hook into that logic at all - perhaps you could add your code to Application_OnStart as this method will fire when ASP.NET recycles the AppPool and restarts the website.
Have you tried Web Deployment projects?
Scott Gu has a blog post.
You can use ASP.NET SignalR to do it, It's real-time web for .NET
Have you tried developing a separate module for ASP.NET that keeps track of last change?
This might put you on the right path (might -- I haven't tried this).
http://www.codersource.net/csharp_iis_metabase.html (dead link)

Why is global.asax missing from a Website Project

A couple of questions regarding the role of global.asax:
Why is it not included in the Website Project in Visual Studio? Are there other ways of achieving the same functionality without this file?
If I would create a Web Application project, as far as I remember, a global.asax file would be created. If I were to delete it, would the project run?
I tried to look for some explanation regarding the global.asax compilation but didn't find any info about this.. would appreciate help/links. :)
Thanks!
An ASP.NET site can run without the global.asax file. Here is a question which talks about alternatives of global.asax file.
Even if you delete a global.asax file your site will work.
Globax.asax is not required by ASP.NET for a website to run. It is, however, very useful for application-level functionality (like unhandled exception logging).
You can add Global.asax to the website project and it will work fine.
Global.asax is not added by default for web applications. If you have it, you can delete it without problems.
Be careful to include the .compiled files when deploying the website or else the events in Global.asax will not fire.
It sounds like you are familiar with Web Application Projects, now see a Web Site "project" and wonder what's going on. In any case, I'll answer as though that were true. ;-)
In Visual Studio 2005, Microsoft introduced Web Site "projects", which are not projects - they're just directory structures on a local disk, FTP site, etc. They do many things differently from Web Application Projects, and can therefore be confusing (especially if you're like me, trying to answer people's questions, not knowing which they are using).
With Visual Studio 2005 SP1, they restored Web Application Projects. If that's what you're more familiar with, then I suggest you use them. They're real projects, just like they always were.
And, BTW, there will be a global.asax, just like there used to be...

Resources