How to create valid setup project for NET 5.0 solution having multiple interlaced exe projects sharing same dlls?

vb 286 Reputation points
2021-02-01T17:53:15.753+00:00

Hi!

I have upgraded multi project windows Framework 4.8 solution to NET 5.0. and...
Microsoft Visual Studio Installer Projects 0.9.9. setup project is having trouble recognizing shared dll-s.

Details...

Setup's target installation is, classically, into one Windows Program files folder.
Solution projects share same dll-s and when Setup packs them into msi file, msi has duplicate files...

MSI content...

file1.dll
file1.dll
file1.dll
...
file2.dll
file2.dll
file2.dll
...

with a zillion warnings while building...

"WARNING: Two or more objects have the same target location ... "
...

How to correct this problem?

I have set exe projects at Setup as their Publish version....

Project1.exe, Publish Items & "Project1\PublishProfile"
Project2.exe, Publish Items & "Project2\PublishProfile"
Project3.exe, Publish Items & "Project3\PublishProfile"
...

where solution is made from about 20 dll projects and 6 exe projects

Each exe project's publish profile is identical...(same publish spot)

<Project ...>
 <PropertyGroup>
 <Configuration>Release</Configuration>
 <Platform>x64</Platform>
 <PublishDir>..\Build\Publish\Release64</PublishDir>
 <PublishProtocol>FileSystem</PublishProtocol>
 <TargetFramework>net5.0-windows</TargetFramework>
 <RuntimeIdentifier>win-x64</RuntimeIdentifier>
 <SelfContained>false</SelfContained>
 <PublishSingleFile>False</PublishSingleFile>
 <PublishReadyToRun>True</PublishReadyToRun>
 </PropertyGroup>
</Project>

Thanks in advance!
Vladimir

P.S. Also, Visual Studio Community MSBuild process is making VS-UI unresponsive when I convert even one projects setup config from "Project Output" to "Publish Items".
P.S.S: I have tried separate publish places...same result.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,252 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,178 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
40,182 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Dylan Zhu-MSFT 6,421 Reputation points
    2021-02-02T03:26:01.183+00:00

    Hi vbAtom,

    Please follow these steps to remove the duplicated dlls from exe:

    1. Right-click "Publish Items From XXX(Active)"
      62831-image.png
    2. Click "Exclude Filter"
    3. Create a filter for a duplicated file
      62802-image.png

    Best Regards,
    Dylan


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our **documentation to enable e-mail notifications if you want to receive the related email notification for this thread.**

    0 comments No comments

  2. vb 286 Reputation points
    2021-02-02T07:19:57.213+00:00

    Thank you very much!

    Sorry, but, thou it is one of probable solutions, I cannot accept it as answer.

    It does not automatically maintain, detect dependencies like it is supposed to be.

    Also, it does not solve Visual Studio Community unresponsiveness... as msbuild becomes crazy when I put even
    one of projects from "Setup Project Output" => "Setup Publish Items".

    This VS stalling makes me to believe that... "Microsoft Visual Studio Installer Projects 0.9.9" + "Visual Studio" + "Publish Items" = having bug.

    One of possible solutions is to make separate Solution, put setup there, and add files from the Publish folder directly into setup.
    This would have same maintenance problem as your solution, but, I would get rid of Visual Studio stopping being responsive.

    I did reset Visual Studio settings, did reset VS shadow cache, and, I will try to completely reinstall Visual Studio...but I'm pretty sure there is a bug in Visual Studio and Microsoft Visual Studio Installer Projects 0.9.9. when using "Publish Items" selection.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.