Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

generation of designer file failed

Every few days VS2008 decides to get mad at me and fails to generate a designer file claiming it cannot find the file specified and that it's missing an assembly. Here's the scenario:

The aspx page has a reference to a custom user control (inheriting UserControl) which references another assembly in the backend. There are many other references to this "missing" assembly in other places in code which don't throw errors. rebuilding, updating the source to the clean copy, shouting at the computer, punching the screen, etc all fail to work.

Any suggestions? This is quite annoying.

like image 762
Pauly Avatar asked Aug 28 '08 16:08

Pauly


2 Answers

We've had similar problems before, unfortunately I don't remember the exact solution.

If your using a "Web Site" project (no project file) then start by checking that both your page and your control both set the ClassName property in the first line of your aspx/ascx file and that you specify the full name of the class including the namespace.

Example:

<@Control Language="VB" AutoEventWireup="false" ClassName="YourProjectName.YourUserControl" Inherits="YourProjectName.YourUserControl" CodeFile="YourUserControl.ascx.vb" %>

Many times not setting all of these will still work but you will get odd compiler errors and behavior in VS.

If you using a Web Site Application project try deleting the designer file manually and then right click on your project and choose "Convert from Web Application." This will should recreate the designer file for you.

My only other suggestion would be to recreate the page and/or the user control from scratch.

like image 74
jColeson Avatar answered Sep 19 '22 09:09

jColeson


Jared, you've hit it. Using "Convert to Web Application" to manually generate the designer file solves my problem. I'm glad you posted this before i started reinstalling. Thanks.

like image 42
Pauly Avatar answered Sep 23 '22 09:09

Pauly