Deployment Project worked last time, now fails

Bryan Valencia 186 Reputation points
2021-01-21T00:13:31.137+00:00

windows 10
VS 2019
Winforms app.
.Net Framework 4.8
Deployment Project NOT CLICKONCE
I have a setup with a deployment project but there are several issues.

The winforms app is set to compile for "Any CPU"
58921-capture.jpg

Rebuilding the installer shows Packaging File... twice for all the required DLLs and application files.

Packaging file 'System.Diagnostics.Tracing.dll'...
Packaging file 'System.Diagnostics.Tracing.dll'...
Packaging file 'LowesLogo.ico'...
Packaging file 'LowesLogo.ico'...
Packaging file 'SpreadsheetLight.dll'...
Packaging file 'SpreadsheetLight.dll'...
Packaging file 'System.Net.Http.dll'...
Packaging file 'System.Net.Http.dll'...
Packaging file 'System.IO.Packaging.xml'...
Packaging file 'System.IO.Packaging.xml'...
Packaging file 'Lowes Importer.exe.config'...
Packaging file 'Lowes Importer.exe.config'...
Packaging file 'System.Drawing.Common.dll'...
Packaging file 'System.Drawing.Common.dll'...
Packaging file 'DocumentFormat.OpenXml.xml'...
Packaging file 'DocumentFormat.OpenXml.xml'...
Packaging file 'System.IO.Compression.dll'...
Packaging file 'System.IO.Compression.dll'...
Packaging file 'System.Threading.Tasks.dll'...
Packaging file 'System.Threading.Tasks.dll'...
Packaging file 'SpreadsheetLight.xml'...
Packaging file 'SpreadsheetLight.xml'...
Packaging file 'DocumentFormat.OpenXml.dll'...
Packaging file 'DocumentFormat.OpenXml.dll'...
Packaging file 'netstandard.dll'...
Packaging file 'netstandard.dll'...
Packaging file 'System.IO.Packaging.dll'...
Packaging file 'System.IO.Packaging.dll'...
Packaging file 'System.Net.Http.dll'...
Packaging file 'System.Net.Http.dll'...
Packaging file 'System.IO.Compression.FileSystem.dll'...
Packaging file 'System.IO.Compression.FileSystem.dll'...
Packaging file 'System.Drawing.Common.dll'...
Packaging file 'System.Drawing.Common.dll'...
Packaging file 'Lowes Importer.exe'...
Packaging file 'Lowes Importer.exe'...
Packaging file 'SpreadsheetLight.dll'...
Packaging file 'SpreadsheetLight.dll'...
Packaging file 'DocumentFormat.OpenXml.dll'...
Packaging file 'DocumentFormat.OpenXml.dll'...
Packaging file 'System.IO.Packaging.dll'...
Packaging file 'System.IO.Packaging.dll'...

There are several underlined DLLs in the "Application Folder" that seem to be a problem, but there's no way to delete them.
58872-capture2.jpg

Next: Even though I told it to build for "any CPU", it insists on deploying to C:\Program Files (x86), implying it's building a 32 bit program.

And last but not least: The installed program REFUSES TO RUN. Oh, it runs on my development machine, but NOT on the client's machines. I tracked it in task manager, and it seems to run for a sec, then quit without an error message. I have tried running it regular and in admin mode.

I have been searching for any info I can find about these problems, but nothing is working yet.

My desired goal is:

  1. The program should run, preferably in 64 bit mode.
  2. The installer should stop packaging the same items multiple times.

That's it really. Any experts out there know what the HELL is happening to me?

Seriously, this WORKED the last time I installed.

I'd be happy to share any project files you guys need to help with this.

Community Center | Not monitored
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Dylan Zhu-MSFT 6,426 Reputation points
    2021-01-21T07:48:13.077+00:00

    Hi BryanValencia,

    1.The program should run, preferably in 64 bit mode.

    Please try to go to Project Properties, then untake the Prefer32-bit
    58966-image.png

    2.The installer should stop packaging the same items multiple times.

    Please try to clear all items in Application Folder, then re-add related assemblies and files

    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. RLWA32 49,636 Reputation points
    2021-01-21T12:55:15.547+00:00

    Next: Even though I told it to build for "any CPU", it insists on deploying to C:\Program Files (x86), implying it's building a 32 bit program.

    You need to create a 64-bit installer. In the property pane for the installer project you can set the TargetPlatform property as follows -

    59172-x64prop.png

    As far as all the assemblies listed in the output folder are concerned you need to determine which of them should already be installed on a target system through a Microsoft supported prerequisite (e.g., some version of .Net Framework) and which are related to a third party product (e.g., SpreadsheetLight) that may need its own installation. I don't know if you can create a prerequisite for non-MS products using a Visual Installer project. In any event, its likely that these individual assemblies should not be installed as standalone files by your installer project.

    0 comments No comments

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.