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

by praveen 11/14/2008 4:37:11 PM

 

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.



Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

ASP.NET | Tips and Tricks

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading



Calendar

<<  January 2009  >>
MoTuWeThFrSaSu
2930311234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar

Recent comments

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway. We try our best to write good code, but none of the code here is tested on Production boxes. Feel free to use the code, BUT test it before you do so (in simple words... use it at your own risk)

© Copyright 2009

Sign in