You receive an "Unable to build custom action" error message when you build a Setup project (814744)



The information in this article applies to:

  • Microsoft .NET Framework 1.0
  • Microsoft Visual Studio .NET (2002), Academic Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2002), Professional Edition

SYMPTOMS

When you open an existing Microsoft Visual Studio .NET Setup project with custom actions that refer to detected dependency files, and you try to rebuild the project, you receive the following error:

Unable to build custom action named 'CustomActionName' because it references an object that has been removed from the project.

WORKAROUND

To work around this problem, exclude the existing detected dependency, and then add the same dependency as a file. To do this, follow these steps:
  1. In Solution Explorer, expand Setup1.
  2. Expand Detected Dependencies.
  3. Right-click MyTestLibrary.dll, and then click Exclude.
  4. In Solution Explorer, right-click Setup1, point to Add, and then click File.
  5. Locate MyTestLibrary.dll, and then click to select it. Click Open.
  6. On the View menu, point to Editor, and then click Custom Actions.

    Custom Actions Editor is displayed.
  7. Right-click MyTestLibrary.dll, and then click Delete.
  8. Right-click Install, and then click Add Custom Action.
  9. Locate and then select the file that is added in step 5, and then click OK.
  10. In Solution Explorer, right-click Setup1, and then click Build.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Microsoft Visual Studio .NET (2003).

MORE INFORMATION

Steps to Reproduce the Behavior

  1. In Visual Studio .NET, create a Class Library project named MyTestLibrary by using Visual Basic .NET or Visual C# .NET.

    By default, Class1 is created.
  2. Rename the solution Solution1.
  3. In Solution Explorer, right-click MyTestLibrary, and then click Build.
  4. In Solution Explorer, right-click Solution1, point to Add, and then click New Project.
  5. Click to select Windows Application, and then click OK to add WindowsApplication1 to Solution1.
  6. In Solution Explorer, right-click WindowsApplication1, and then click Add Reference.
  7. Click Browse. Locate MyTestLibrary.dll, and then click to select it.
  8. Click Open, and then click OK.
  9. In Solution Explorer, right-click WindowsApplication1, and then click Build.
  10. Right-click Solution1, point to Add and then click New Project.
  11. Click to select Setup Project, and then click OK to add Setup1 to Solution1.
  12. In Solution Explorer, right-click Setup1, point to Add, and then click Project Output.
  13. Under Project, click to select WindowsApplication1 in the Add Project Output Group dialog box.
  14. Click to select Primary Output, and then click OK.

    MyTestLibrary.dll is added under Detected Dependencies.
  15. On the View menu, point to Editor, and then click Custom Actions.

    The Custom Actions Editor is displayed.
  16. Right-click Install, and then click Add Custom Action.
  17. Locate the detected dependency MyTestLibrary.dll, and then click to select it. Click OK.
  18. In Solution Explorer, right-click Setup1, and then click Build.
  19. Close and reopen Solution1.
  20. In Solution Explorer, right-click Setup1, and then click Build.

    You receive the error mentioned in the "Symptoms" section of this article.

REFERENCES

For more information, visit the following MSDN Web sites:

Modification Type:MajorLast Reviewed:1/26/2006
Keywords:kbvs2005swept kbvs2005doesnotapply kbenv kbDeployment kbIDEProject kbide kbsetup kbWindowsForms kbForms kbfix KB814744 kbAudDeveloper