views:

1122

answers:

5

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.

A: 

You might try archiving a template of a new file with its designer equivalent. If VS coughs then you can do an "Add Existing" option with the file you already have.

It seems, however, to be an issue with your installation of VS2008 so you might try reinstalling it.

David in Dakota
A: 

Thanks, David, I will likely end up reinstalling. I cannot figure out the cause still after looking through every possible avenue.

Pauly
+4  A: 

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.

Jared Coleson
+2  A: 

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.

Pauly
A: 

I found that using a custom control, you would need to add a reference to the .dll. This fixed it for me after migrating from a web site to web app.

Bay Wolf