Last post Apr 09, 2009 02:37 PM by puterart
Jan 16, 2008 11:09 AM|craigmo|LINK
I have VS 2005 Professional Edition and Microsoft Web Deployment Projects 2005 installed. I have a solution that consists of two web sites, some class libraries, and some aspx, ascx files that
should not be compiled when I build the solution. I'm not going to go into detail why the aspx and ascx files should be compiled, because that would make this post longer than I want it to be, and I want to keep this post as short as possible.
I tried to exclude the folder that contains the ascx and aspx files by adding the ExcludeFromBuild node to the wdproj file as follows:
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Security is the folder that contains all the aspx and ascx files I want excluded from the build (actually, "Security" contains a number of folders, some nested, which contain that ascx, aspx files -- hence the \**\ to indicate nested folders. I verified
that $(SourceWebPhysicalPath) is correct by looking at the SourceWebPhysicalPath node at the top of the wdproj file.
The problem is that I cannot get this to work. The compiler still tries to include the files I want excluded from the build. VS 2005 thus barfs and generates a bunch of compiler errors related to the ascx and aspx files, which I want excluded from the
build, and which I tried to do.
I could theoretically manually select each file I want excluded in the solution explorer, right-click and select "Exclude from project," but as there are 100+ files, this would be a major pain in the a**. I'd really like to simplify this by using the <ExcludeFromBuild>
node, but am getting really frustrated because I cannot get this to work, and I'm sure I'm following the instructions provided by Microsoft.
Jan 18, 2008 04:16 PM|craigmo|LINK
OK, looks like you can only do this for web applications, NOT web sites. I just tried it for a web application and it worked fine.
Feb 05, 2008 10:22 AM|JoeReynolds|LINK
I have a WDP that I cannot compile. It needs to use the IIS metabase Path to find some include files. However, I also have RadControls virtual directory and I need to exclude it. If I exclude the directory via "ExcludeFromBuild" then compile produces an
error of "The MetabasePath parameter cannot be combined with VirtualPath or PhysicalPath.
Is the error related to using both metabasepathth and excludefrombuild? If so, is this a Catch22 situation or is there a solution?
Feb 05, 2008 02:26 PM|JoeReynolds|LINK
I solved my problem. Was due to the way I was handling some include files left over from pre-aspx days in a migrated application.
Apr 09, 2009 11:53 AM|puterart|LINK
Apr 09, 2009 12:40 PM|JoeReynolds|LINK
puterart, wish I could help but my issue was over a year ago and I can't even recall the exact problem, much less what I did to solve it. [:)]
Apr 09, 2009 02:37 PM|puterart|LINK
Haha, understandable. The weird thing is my entire deployment project builds but craps out when I add an <ExcludeFromBuild Include="$(SourceWebVirtualPath)/web.config" /> or any excludefrombuild tag into the ItemGroup. Any ideas?