Web Deployment Project: ASPPARSE: Could not load type
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.
To Delete or include the files is not always a viable option. I am finding that Web Deployment Projects are very buggy and they themselves should be avoided.
Thanks for posting this. I’ve spent 8 hours googling & trying everything I could think of to fix this problem. I can’t believe that WDP doesn’t read the WAP manifest to determine which files to include.
Thank you for this. Saved me a ton of time.
Actually, this does not work for me.
I copy the files I don’t want to delete off into a completely separate directory (so I don’t lose the work) and delete the files through Visual Studio (rather than directly in the file system). I try to rebuild and still get the error. I have to copy the files back, even though I don’t want them in the project.