I have some .Net6 WinForm application that supposed to run PowerShell script via System.Management.Automation package Version="7.2.2". This app works fine. For this app I should prepare setup.exe to install it on other computer. This my solution explorer window The problem is when I am trying to create Setup Project through Microsoft Visual Studio Installer Projects 2022 extension. Build edns with this error
Build started...
1>------ Build started: Project: WinFormsApp1, Configuration: Release Any CPU ------
1>WinFormsApp1 -> C:\Users\disergeev\source\repos\WinFormsApp1\WinFormsApp1\bin\Release\net6.0-windows\WinFormsApp1.dll
------ Starting pre-build validation for project 'Setup1' ------
------ Pre-build validation for project 'Setup1' completed ------
2>------ Build started: Project: Setup1, Configuration: Release ------
Building file 'C:\Users\disergeev\source\repos\WinFormsApp1\Setup1\Release\Setup1.msi'...
ERROR: Unrecoverable build error - 0x8007000B
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I tryed this solution and this, but nothing helps. If I delete PackageReference to System.Management.Automation and it's usage functions in WinFormsApp1 Setup Project builds successfully, so problem should be in this package. Relying on this answer you might think that package referenced to 32-bit binaries but I can't handle it anyway.
My question is how to build setup project with this package or which package may substitute it?