How do you handle excluded files with aspnet_compiler?

I am trying to use aspnet_compiler to move a project that is already compiled from one place to another. I use Subversion for version control.

The process basically deduces all the code from subversion, builds, then calls aspnet_compiler.

My problem occurs when I have an excluded ascx file. This file is part of the latest code, but the regular assembly compiler ignores it, so no problem. However, the Aspnet_compiler explodes because it cannot find the code for this particular control.

I'm not sure

  • I am doing it right;
  • is there a way to get the correct file tree from Subversion
  • There is an easier way; or
  • this is expected, and I need to delete excluded files every time.

I would be grateful for any help.

Tom

+6
svn web-deployment
source share
3 answers

Expected: Aspnet_compiler.exe compiles all the files in the application and does not look at the project file. Thus, it has no concept of excluded file.

Babak Nuffโ€™s suggestion to delete a file is probably the easiest way to access the file, rather than manually deleting it (or writing to delete it) each time.

+3
source share

Since .NET 4.5 or 4.5.1 (I'm not sure what), the -x option has been added to aspnet_compiler.exe, which allows excluding directories from compilation. You can find the option through the command "aspnet_compiler /?".

-x The virtual path of a directory that should be excluded from precompilation. This switch can be used multiple times. 

Example:

My website has a folder named "ToBeExcluded". I can use the following command to precompile the website and exclude this folder,

 aspnet_compiler -v /foo -p "C:\MyWebsite" -x ToBeExcluded "c:\temp\web" 
+6
source share

I struggled with this for so long. But finally found a workaround

 attrib +h folderToExclude & runAspComplierWithAllOptions & attrib -h folderToExclude 

Hide folder โ†’ compile โ†’ show folder.

+1
source share

All Articles