Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to perform a "Refresh Dependencies" in a setup project outside VS2008?

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.

like image 985
Petros Avatar asked Sep 05 '08 11:09

Petros


People also ask

How do I refresh a Visual Studio project?

In Solution Explorer, select the projects you want to load (press Ctrl while clicking to select more than one project), and then right-click on the project and choose Reload Project. Visual Studio will remember which projects are loaded the next time you open the solution locally.

What is the difference between dependencies and references in Visual Studio?

They are basically no different, they are used to store and manage references. Just as Lex said, the Dependencies is a better way to represent different types of references, we can clearly know where the reference comes from, SDK, nuget, etc. so that we can manage our references more efficiently.


1 Answers

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\"

like image 179
Erick Sgarbi Avatar answered Sep 19 '22 17:09

Erick Sgarbi