Merge pull request #8 from microsoft/dev/sknam/add-multifolder-suppor… · microsoft/VSConfigFinder@2f3da19 (original) (raw)

1

1

`# [Visual Studio] VSConfig Finder

`

2

2

``

3

``

`` -

When you want to set up Visual Studio from a new environment, .vsconfig files can be very useful as they are easy to be created from your existing installations or from a working solution. However, one existing problem with the .vsconfig usage is that Visual Studio Installer supports importing one .vsconfig file at a time, so if you have multiple .vsconfigs throughout your solution (e.g. you have a monorepo that is consisted of multiple projects) and you want to apply them while setting up your pipeline, you would have to run an installer operation as many times as you'd want to use the different .vsconfigs. One way to get around this problem is to generate a single .vsconfig yourself that you put on the root of the solution, but this approach still has its own issues: For example, if you're only interested in a subset of the solution, you'll install far more components than the ones you need, resulting in a longer install and subsequent update time.

``

``

3

`` +

When you want to set up Visual Studio from a new environment, .vsconfig files can be very useful as they are easy to be created from your existing installations or from a working solution. However, one existing problem with the .vsconfig usage is that the Visual Studio Installer supports importing one .vsconfig file at a time, so if you have multiple .vsconfigs throughout your solution (e.g. you have a monorepo that is consisted of multiple projects) and you want to apply them while setting up your pipeline, you would have to run an installer operation as many times as you'd want to use the different .vsconfigs. One way to get around this problem is to generate a single .vsconfig yourself that you put on the root of the solution, but this approach still has its own issues: For example, if you're only interested in a subset of the solution, you'll install far more components than the ones you need, resulting in a longer install and subsequent update time.

``

4

4

``

5

5

`` VSConfigFinder is designed to be a redistributable, single-file executable that can be used in build or deployment scripts to use multiple .vsconfigs that exist throughout the solution without having to go through multiple installer operations by recursively finding nested .vsconfig files and merging them into a single output file, or an installer command line argument, depending on the customer requirement.

``

6

6

``

`@@ -14,6 +14,7 @@ Imagine that you have a solution or a repository with the folder structure as be

`

14

14

`root

`

15

15

` - folderA

`

16

16

` - folderB

`

``

17

`+

`

17

18

` - folderC

`

18

19

` - someProject

`

19

20

` - .vsconfig (packageA, packageB)

`

`` @@ -30,10 +31,22 @@ If you want to pass in all the components that are needed to build & run `folder

``

30

31

``

31

32

`This will generate the following command as a console output that you can simply pass into the installer.

`

32

33

``

33

``

`` -

--add packageA packageB packageC packageD

``

``

34

`` +

--add packageA --add packageB --add packageC --add packageD

``

34

35

``

35

36

`` Remember to add your own verb (e.g. install or modify) in conjunction with the tool output.

``

36

37

``

``

38

`+

Multi-Root Folders Support

`

``

39

+

``

40

`` +

Say if you want to do something similar to the example above, but you want everything under folderB AND folderC. You cannot pass in one or the other, because the two do not share a common folder (if you pass in the root, folderA will also be included). Instead, you can simply pass in the topmost folders as a list to achieve your goal.

``

``

41

+

``

42

`` +

VSConfig.exe --folderpath root\folderC root\folderB

``

``

43

+

``

44

`+

This will generate the following command as a console output that you can simply pass into the installer.

`

``

45

+

``

46

`` +

--add packageA --add packageB --add packageC --add packageD --add packageE

``

``

47

+

``

48

`` +

Again, remember to add your own verb (e.g. install or modify) in conjunction with the tool output.

``

``

49

+

37

50

`## Alternate Example

`

38

51

``

39

52

`` Alternatively, you can pass in additional parameters provided by the tool to get the merged .vsconfig as a single file:

``

`@@ -42,6 +55,8 @@ Alternatively, you can pass in additional parameters provided by the tool to get

`

42

55

``

43

56

`` This will generate an alternate single .vsconfig file with all the needed components in the specified configOutputPath. If you don't specify a configOutputPath, the output directory will default to the current directory.

``

44

57

``

``

58

`` +

Note that if you choose to use --createfile, the Visual Studio Installer arguments will no longer be output to the console.

``

``

59

+

45

60

`## Contributing

`

46

61

``

47

62

`This project welcomes contributions and suggestions. Most contributions require you to agree to a

`