Understanding "Generation of designer file failed" error when using Web Application Project

So you have migrated from Web Site Project -> Web Application Project and when working with the IDE you face the scary message - "Generation of designer file failed", the actions that you need to take are:

  1. Relax - don't think about rolling back YET
  2. Import the following registry file

    REGEDIT4
    [HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\WebApplicationProjects\Debug]
    "LogFile"="C:\\logfile.txt"
    "Enabled"=dword:00000001
    "LogFieldGeneratorFailures"=dword:00000001

  3. Reproduce the problem
  4. Examine the log file under "c:\logfile.txt"
  5. Try fixing your self (could be very easy)
  6. Post question / fix in the forum

Hope that this help you.

Understanding "Generation of designer file failed" error when using Web Application Project Understanding "Generation of designer file failed" error when using Web Application Project Reviewed by Ran Davidovitz on 1:01 AM Rating: 5

7 comments:

Ryan McDonnell said...

You are a life-saver! I kept getting the following error after converting my web project into a web application:

"Generation of designer file failed: Exception has been thrown by the target of an invocation."

Once I could see the log file, it pointed me in the right direction for solving the problem. In my case, the issue was a null reference on a private string in a class library. The string wasn't ever called at runtime so the compiler never complained about it. Apparently, the designer generation process will test some unused variables.

Thanks again!

Ran Davidovitz said...

No problem, its nice to see that a simple blog post did the job (i earned my nickel)

Mike said...

Any idea what the reg key is for VS08?

Ran Davidovitz said...

Didn't check , but I guess simply change 8.0 to 9.0, tell me if that works.

Also i heard people saying to reset the visual studio setting also helps (as a last resort)

Thierry Lach said...

Yep - changing 8 to 9 did it.

Anonymous said...

Unfortunately this didn't work for VS2010. Any idea?

Ran Davidovitz said...

Can you share what registry did you change and what other hives of registry you have ?

Powered by Blogger.