Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Web Deployment Projects: getting rid of .compiled files

I'm using a Web Deployment Project in Visual Studio 2008 in order to prepare my ASP.NET application (ASP.NET web application, not ASP.NET web site) for being copied to several servers. I have to copy the files on local staging servers, on different servers via FTP and sometimes I have to fetch them from customers' servers.

So, it would be nice to have all files for deployment in a compact form without the necessity of doing a lot of comparing between source and destination. Web deployment projects have this nice feature: compile all your aspx and ascx files into a single (additional) assembly.

I somehow found out how to get rid of aspx placeholder files on the server, now I'd like to know if there is a (maybe self-made) way to get rid of these .compiled files.

From Rick Strahl's blog:

The .Compiled file is a marker file for each page and control in the Web site and identifies the class used inside of the assembly. These files are not optional as they map the ASPX pages to the appropriate precompiled classes in the precompiled assemblies. If you remove the .Compiled file, the page that it maps will not be able to execute and you get a nasty execution error.

Anybody out there with a creative idea, maybe using a module/handler which intercepts the check against the .compiled files in the bin folder?

like image 453
splattne Avatar asked Jan 15 '09 15:01

splattne


3 Answers

The .compile file comes from pre-compiling on deployment. So you basically have 3 options:

  1. Keep the .compiled file
  2. Don't pre-compile and deploy source code
  3. Turn this in to a Web Application instead of a Web Site and compile as an assembly

I have run in to the same problem myself. I actually choose #1 in most cases when dealing with deployment of Web Sites, but on the rare occasion when I know I am going to have to maintain the site for an extended period of time, I take the time to upgrade it to a Web Application.

like image 66
Nick Berardi Avatar answered Oct 19 '22 13:10

Nick Berardi


I don't like the .compiled files either, but nobody gets hurt if they're there. So why bother?

like image 34
devio Avatar answered Oct 19 '22 14:10

devio


You might want to take a look at Virtual Path Providers (KB how to here) in ASP.NET.

Credit for this suggestion must go to Cheeso and his self answered question here:

Can I get “WAR file” type deployment with ASP.NET?

like image 1
Zhaph - Ben Duguid Avatar answered Oct 19 '22 13:10

Zhaph - Ben Duguid