views:

440

answers:

1

I have a solution with several projects. One of them is a setup project. If you expand the setup project in the Solution Explorer, you see a Detected Dependencies node. If you right click on it, you get a menu item called Refresh Dependencies. This refreshes any dependencies based on the files included in the setup.

I am asking if I can execute this action outside Visual Studio, using either devenv.com or MSBuild.

I want this because I am using CruiseControl.NET for continuous integration and in some solutions I found that the setup output is missing some dependencies because of the way I automatically build the projects.

Update:

It turned out that my setup is not very friendly to how Setup projects work in Visual Studio. I ended up using Post Build Events in order to create the whole application structure ready to just be copied to a computer and work out of the box. I am not using setup projects in Visual Studio anymore, unless I really have to.

+1  A: 

Record or create a macro:

Option Strict Off
Option Explicit Off
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports System.Diagnostics

Public Module RefreshDependencies
    Sub TemporaryMacro()
        DTE.ActiveWindow.Object.GetItem("Project\Setup1\Setup1").Select(vsUISelectionType.vsUISelectionTypeSelect)
        DTE.ExecuteCommand("Build.RefreshDependencies")
    End Sub
End Module

Then just call the macro in the command line:

devenv /command "Macros.MyMacros.RefreshDependencies C:\MyProjects\MyApp\"

Erick Sgarbi