question

vbAtom avatar image
0 Votes"
vbAtom asked vbAtom edited

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

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.



vs-generaldotnet-runtimevs-msbuild
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DylanZhu-MSFT avatar image
0 Votes"
DylanZhu-MSFT answered

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.


image.png (15.5 KiB)
image.png (9.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

vbAtom avatar image
0 Votes"
vbAtom answered vbAtom edited

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.




· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @vbAtom, thank you for feedback. We suggest you can report it to QA in Microsoft Visual Studio Installer Projects page

0 Votes 0 ·

QA @ Microsoft Visual Studio Installer Projects page?

I'm not sure that here is problem at my solution or it is some bug.

I suppose, someone would already detect problem at Microsoft Visual Studio Installer Projects team, because, scenario for it is clear...stall problem is occurring after solution Framework to NET conversion....and converting setup references from Project output => Publish items.

Maybe problem is only for VS Community?

I can only reference this topic there. Should I?

0 Votes 0 ·

Currently I have applied following...

I have created separate Solution for setup.

Native C++ dll projects I have referenced there as: Solution -> Add Existing Project...and then: Solution->Setup->Add Project output.

Then...Publishing for NET 5.0 exe files I invoke by script that uses msbuild.exe to publish NET exe files,
Script is fired in pre-build action of Setup.install project.

Dll & exe files from output publish folder I have referenced in Setup...by...Setup->Add files "from publish folder".
I had to select & exclude all dependencies detected by setup cause they are already included by former Setup->Add files "from publish folder" act.

...


0 Votes 0 ·

If some new assemblies are produced...I will have to manually refresh setup list by selecting all referenced at setup published files, removing, adding again full list.
It is not a big problem because it is done by simple select all actions.
While testing refresh, sometimes I had to restart VS so setup refreshes it internal content properly.

Also, I have to do Setup->Clean & Setup->Rebuild when producing setup.exe ... so that it build/fetches fresh published items.

Now main solution has no setup, setup has no dynamic reference update, but, has no duplicates in msi, no stall & unresponsive behavior.

I get some dependencies warnings while building setup...nothing serious.,,instalation runs OK and all files needed are at Program Files place.

0 Votes 0 ·