Having your custom ASPX page in an ASP.NET compiled Website

by praveen 11/15/2008 3:55:11 AM

 

When you publish an ASP.NET website using Visual Studio it will give you a pre-compiled site. This process of pre-compilation does various actions on the ASPX pages. Files are treated differently. There are various reasons why you would want to pre-compile your ASP.NET site. If you need more details on that you could go here or here.

 

Now when you have a pre-compiled site, there are a few problems you run up against. For example you run into issues with Global.asax and I have read some blogs where folks have run up against the exact same problem I am talking about. How do I run my own developed custom ASPX pages inside of a pre-compiled website?

 

While trying to look for a solution for this, most places I read that you can just get rid of the precompiledApp.config file and you should be good to add your own stuff to the website. But this didn't really help me as I was still not able to run a simple ASPX page with inline source code. What finally did help was good old MSDN and the following article.

File Handling During ASP.NET Precompilation 

 

So basically if you read through this, it tells us that a .compiled output file is generated for each ASPX page in the website. We also have the respective assembly file which is located in the bin directory. So let us say that I have an ASP.NET website with a main.aspx. When I publish this. I get the main.aspx.compiled and the App_Web_xyz.dll in the bin directory.

I copied these files over to the bin directory of the pre-compiled website and my pages started working again.



blog comments powered by Disqus

Comments

Search


Tags



Categories

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

All Items
Sign in

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2010, Rahul Soni

Powered by BlogEngine.NET 1.4.5.0