问题
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.
- pdb files are removed.
- dlls(netstandard.dll,System.Diagnostics.Tracing.dll,System.IO.Compression.dll,System.IO.Compression.FileSystem.dll,System.Net.Http.dll) ares added.
- 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
As I said, I only added the output of the project to the directory of installer project, what causes the difference 2 and 3?
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