Could not create constructor file

Every few days, VS2008 decides to get angry with me and cannot create a designer file stating that it cannot find the specified file and that it lacks an assembly. Here's the script:

The aspx page has a link to a user control (inheriting from UserControl) that references another assembly in the backend. There are many other references to this β€œmissing” assembly elsewhere in the code that do not cause errors. rebuild, update the source to a clean copy, scream on the computer, punch the screen, etc. all do not work.

Any suggestions? This is pretty annoying.

+6
visual-studio-2008 visual-studio
source share
4 answers

We had similar problems before, unfortunately, I do not remember the exact solution.

If you are using a Web site project (without a project file), start by checking that both your page and your control set the ClassName property on the first line of your aspx / ascx file and specify the fully qualified name of the class, including the namespace.

Example:

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

Many times not installing them all will work, but you will get errors and compiler behavior in VS.

If you are using a website application project, try deleting the designer file manually, then right-click on your project and select Convert From Web Application. This should recreate the designer file for you.

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

+8
source share

Jared, you hit him. Using Convert to Web Application to manually create the constructor file solves my problem. I'm glad you posted this before I started the reinstallation. Thanks.

+2
source share

You can try to archive a new file template with its developer equivalent. If VS coughs, you can make the option "Add existing" with the file that you already have.

This seems to be the problem with your VS2008 installation, so you can try reinstalling it.

0
source share

I found that with a custom control, you would need to add a link to the .dll. This fixed it for me after switching from website to web application.

0
source share

All Articles