Search code examples
c#visual-studiosetup-projectsolutionmerge-module

Merge Module in setup project across different solutions says “unable to determine name”


A setup project is shared between two solutions:

  1. SetupOne.sln
  2. SetupTwo.sln

The setup project also contains the output from a Merge Module. In the setup project in SetupOne.sln, it references this Merge Module as expected. However, in SetupTwo.sln it says “unable to determine name” and fails to build. “Fixing” this issue by re-adding the Merged Module in the solution SetupTwo.sln then breaks the Merged Module reference in SetupOne.sln - it now says “unable to determine name” and fails to build.


Solution

  • This is due to a GUID mismatch in the solution file. I’ll illustrate the fix as follows:

    Create two new empty solutions, SetupOne and SetupTwo. In SetupOne, add a new setup project called SetupOne and add a new MergeModule project called MergeModule. Add the MergeModule to SetupOne in the usual way. You should have something that looks like this:

    enter image description here

    Now add into SetupTwo the existing projects SetupOne and MergeModule. You should now have something that looks like this:

    enter image description here

    Note that we have “unable to determine name” in the project SetupOne in the solution SetupTwo. This will cause the build to fail. To fix this, open SetupOne.sln and SetupTwo.sln in a text editor. In SetupOne.sln we have:

    Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "SetupOne", "SetupOne\SetupOne.vdproj", "{8AF96D5B-4852-4862-9894-0278ED68054C}"
    EndProject
    Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "MergeModule", "MergeModule\MergeModule.vdproj", "{55F30708-F70E-4B78-9F3C-F312BFB1AF80}"
    EndProject
    

    And in SetupTwo.sln we have:

    Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "SetupOne", "..\SetupOne\SetupOne\SetupOne.vdproj", "{AE3E9BDE-529F-430C-8EEA-FE5E8A5FAC7D}"
    EndProject
    Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "MergeModule", "..\SetupOne\MergeModule\MergeModule.vdproj", "{5DDD8FE2-8736-4D77-960E-DA98BEB6CB8F}"
    EndProject
    

    The GUIDS for SetupOne and MergeModule in SetupTwo.sln are different from those in SetupOne and MergeModule in SetupOne.sln. Edit the GUIDS for these projects so they are exactly the same across both solutions. When you do this, Visual Solution reloads the SetupTwo solution and we have:

    enter image description here

    Which builds without fail.