5

I am using Visual Studio 2017 and I am using this extension from Microsoft to provide the Visual Studio 2017 the ability to create setup project.

I created new setup project and I added the primary output of an WPF application to that setup project. Every thing is OK here.

The problem is : Visual Studio 2017 Adds the GAC assemblies in the Detected Dependencies section, and also It added them to the Application Folder, Also It is adding them duplicated (each Assembly is Added twice).

here is an image enter image description here Finally when I am using the MSI package to install the application, then the GAC assemblies are copied to folder which contains the application.

So, why Visual studio behave like this, What am I doing wrong?
I tried to exclude the GAC dlls, but VS is overriding this
I wanted to delete the GAC dlls from the Detected Dependencies but vs does not allowed me to do that

I do not want to the GAC assemblies to be copied to the Application Folder, I want to use them from the GAC directly. how to do that?

NOTE 1 : I am using TFS to host the source code of the solution.
NOTE 2 : All the project is build according to Release x64
NOTE 3 : Although there is a read lines under the assemblies, when building visual studio does not give me any errors or warnings.

Updateenter image description here

Hakan Fıstık
  • 11,376
  • 8
  • 74
  • 105
  • Having a dependency on cmd.exe is the most severe issue, I'd say. Hard to guess what you did, smells like you gave the project a non-standard Debug start action setting. Get rid of that first, the rest will probably follow. – Hans Passant May 31 '17 at 09:13
  • Mr @HansPassant I am making dependency on `cmd.exe` because I want to execute batch file after the installation, I brought the idea from [this question](https://stackoverflow.com/questions/2414956) – Hakan Fıstık May 31 '17 at 09:16
  • Well, don't do that, every Windows machine already has a copy of cmd.exe. You never want to destroy it with your installer. – Hans Passant May 31 '17 at 09:19
  • @HansPassant Thank you for advising to remove the cmd.exe, removing it make the red lines under the dlls names to disappears, and the installer is still working as expected, and the batch file is still executing correctly. but the problem of copying GAC assembly did not solve. – Hakan Fıstık May 31 '17 at 09:32
  • Avoid "primary output" if you can. If it's just a single WPF executable or two than just add that file to the Application Folder. – PhilDW Jun 07 '17 at 17:48
  • Similar problem is posted [here](https://stackoverflow.com/questions/38682503/why-mvvm-light-copies-system-assemblies-to-application-folder) too. – dotNET Feb 02 '18 at 04:41

0 Answers0