In my pervious post about using Web Deployment Projects, I forgot to mention about a tiny problem. Web Deployment Project compile all the contents of the Web Application project, this includes all files regardless if they are added to your projects or not.
Potential Problem: an error occurs while compiling Web Deployment Project if there are some excluded WebForms (ASPX files) in the Web Application Project.
In the following example I have a Web Deployment Application linked to WebApplicationTest2. In the WebApplicationTest2, WebForm1 excluded and it cause the following error when I compiled WebApplicationTest2.vbproj_deploy.

After Compiling:
—– Build started: Project: WebApplicationTest2.vbproj_deploy, Configuration: Debug Any CPU ——
if exist “.\TempBuildDir\” rd /s /q “.\TempBuildDir\”
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v /WebApplicationTest2.vbproj -p “C:\Visual Studio 2008\ Projects\WebApplicationTest2″ -u -f -d .\TempBuildDir\
/WebApplicationTest2.vbproj/WebForm1.aspx(1):
error ASPPARSE: Could not load type ‘WebApplicationTest2.WebForm1′.
Done building project “WebApplicationTest2.vbproj_deploy.wdproj” — FAILED.

How to Fix: Make your mind about the excluded files. Include them, or delete them. In this case I included the WebForm1.aspx, then it compiled fine.
