Files in Visual studio debug folder and the generated installer include different dll file

南笙酒味 提交于 2020-01-16 08:47:08

问题


I wrote a WPF app in Visual Studio 2019 and works in debug mode.

But when I created a installer with "Microsoft Visual Studio Installer Projects" Extension, the app created by the installer does not work.

In the project to create the installer, I only added the primary output of my WPF project to "Application Folder".

I compared the debug folder of my Visual Studio and the folder created by the installer, the dll files in the folders are different.

  1. pdb files are removed.
  2. dlls(netstandard.dll,System.Diagnostics.Tracing.dll,System.IO.Compression.dll,System.IO.Compression.FileSystem.dll,System.Net.Http.dll) ares added.
  3. dlls(System.Runtime.CompilerServices.Unsafe.dll,System.ValueTuple.dll) are different.

difference of System.Runtime.CompilerServices.Unsafe.dll is below

  • the one works: 16760 bytes PE Header->Flags: DLL, Handles 32 bit words, Executable
  • the one does not work: 16248 bytes PE Header->Flags: DLL, Handles addresses larger than 2 GB, Executable

Question

  1. As I said, I only added the output of the project to the directory of installer project, what causes the difference 2 and 3?

  2. I replaced the System.Runtime.CompilerServices.Unsafe.dll of installer with the one in my debug folder, and it works.So I removed this dll in "Detected Dependencies" and add the one in debug folder into the "Application Folder" of the installer project.Rebuild and the installer works too.But I want a proper way to fix this problem.

来源:https://stackoverflow.com/questions/59045810/files-in-visual-studio-debug-folder-and-the-generated-installer-include-differen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!