Cannot use Inheritance Picker if solution contains a setup project in Visual Studio .NET 2002 (316195)



The information in this article applies to:

  • Microsoft Visual Studio .NET (2002), Professional Edition

This article was previously published under Q316195

SYMPTOMS

You may receive several "Assembly Load Error" error messages in Visual Studio .NET under the following circumstances:
  • You create a project in Visual Studio .NET.
  • You add a setup project to the solution that contains your new project.
  • You try to add an Inherited Form to the project from the Inheritance Picker dialog box.
The "Assembly Load Error" error messages state that files in the setup project are not valid Visual Studio .NET Framework assemblies. The "Assembly Load Error" error messages are followed by an "Unexpected Error" error message.

CAUSE

This problem occurs if the setup project has been built. By default, the setup project is not built when you build the solution normally. Therefore, you must build the setup project explicitly.

When you build the setup project, the following files are created:
  • InstMsiA.exe
  • InstMsiW.exe
  • Setup.exe
  • Setup.ini
  • Setup1.msi
NOTE: The file name of Setup1.msi depends on the project name of the setup project in the solution.

If you have built the setup project, and if you try to add an Inherited Form to the application, Inheritance Picker interprets these files as generated assemblies and tries to load them. However, because the generated files are not valid .NET Framework assemblies, the Inheritance Picker fails.

RESOLUTION

To resolve this problem, remove the setup project from the solution. To do this, right-click the setup project in Solution Explorer, and then click Remove.

Alternately, if you want to add a new setup project to your solution by using the Setup and Deployment Project option, add the setup project to the solution only when you are ready to package the solution.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Start Visual Studio .NET, and then create new Windows Application project.
  2. In Solution Explorer, right-click the solution, point to Add, and then click New Project.
  3. In the Add New Project dialog box, click Setup and Deployment Projects under Project Types, click Setup Wizard, and then click OK.
  4. In the Setup Wizard, click Next, accept all of the default settings, and then click Finish.
  5. Press CTRL+SHIFT+B to build your solution. Notice that the setup project is not compiled by default.
  6. In Solution Explorer, right-click the setup project, and then click Build.
  7. After you successfully compile both projects, right-click the Windows Application project, point to Add, and then click Add Inherited Form.
  8. In the Add New Item dialog box, click Open to add an Inherited Form.

    Notice that you receive several "Assembly Load Error" error messages, which state that the files that the setup project created are not valid .NET Framework assemblies. Additionally, notice that the Inheritance Picker dialog box does not appear.

Modification Type:MinorLast Reviewed:2/3/2006
Keywords:kbvs2005doesnotapply kbtshoot kbvs2005swept kbprb KB316195