Home > ASP.NET > Web Deployment Project: ASPPARSE: Could not load type

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.

image

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.

image

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.

image

About these ads
Categories: ASP.NET
  1. December 17, 2008 at 2:29 am

    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.

  2. terry
    March 24, 2009 at 11:22 pm

    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.

  3. dave
    June 28, 2009 at 2:24 pm

    Thank you for this. Saved me a ton of time.

  4. Adam
    October 23, 2009 at 8:51 pm

    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.

  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: