Friday, June 18, 2010

Global.asax and precompiled web sites (aspnet_compiler.exe)

I recently deployed a precompiled VS 2010 (.NET 4) website using the aspnet_compiler. For the most part the site would start, but certain things would cause an exception when accessing objects in the Application object (which are initialized in the Application_Start of Global.asax.cs).

It turns out the issue was I didn't deploy the "precompiledApp.config" file that had been generated. For whatever reason, if you don't deploy this file, one of the things that occurs is the code of your Global.asax.cs isn't executed.

Lesson learned...always deploy the precompiledApp.config file.

No comments:

Can't RDP? How to enable / disable virtual machine firewall for Azure VM

Oh no!  I accidentally blocked the RDP port on an Azure virtual machine which resulted in not being able to log into the VM anymore.  I did ...