I’ve inherited a PS forms application that we’ve been using PowerShell Pro Tools to build into an exe, but for the life of me I can’t get it to build an executable.
VS2019 and all the bits on the system requirements are installed (.NET 4.7.2, 4.7.2 Dev Pack, .NET Core 3.1) but when I go to build the solution as an exe via MSBuild I get:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\PowerShell Tools for Visual Studio\PowerShellProTools.targets(4,5): error : Failed to build.
I’ve created a blank PS Forms project and that builds fine and if I un-tick “Package as Executable”, then the script builds fine as a PowerShell script.
I turned on diagnostic logging for PS tools in VS but the log in %APPDATA%\PowerShell Tools for Visual Studio has nothing useful.
Is this a known issue and if not, how can I get some more info about why the project is failing to build?
I wondered if I was missing something obvious in the project file but I’ve flipped the various packaging options on and off to see if makes a difference without success.
I just took a peek at the code and the MSBuild task is eating the actual error and throwing that “Failed to build” error. I made a change that should provide us with more details. Running a build now. I can upload a new kit in about 30 minutes after CI runs and we can see if we can get some more info from your environment.