Getting Error While Generating Exe

Hello,

I am getting some error while generating exe, though it gets generated but nothing works on control, error below:
Any Idea where could be going wrong

------ Build started: Project: ReportFetch_ReclaimationTool, Configuration: Debug Any CPU ------
		Checking license
		OutputPath is E:\IMP Scripts and Files Share SYNCED\New_Scripts_2019\Reclaim_Hybrid_Project\ReportFetch_ReclaimationTool\ReportFetch_ReclaimationTool\bin\Debug\
		Bundling ReportFetch_ReclaimationTool.ps1
		Parsing file ReportFetch_ReclaimationTool.ps1.
		Parsing file E:\IMP Scripts and Files Share SYNCED\New_Scripts_2019\Reclaim_Hybrid_Project\ReportFetch_ReclaimationTool\ReportFetch_ReclaimationTool\ReportFetch_ReclaimationTool.designer.ps1.
		Bundling XAML
		Failed to locate Import-Xaml
		Bundling XAML
		Failed to locate Import-Xaml
		Packaging C:\Users\User1\AppData\Local\Temp\ReportFetch_ReclaimationTool.ps1
		Creating temp directory: C:\Users\User1\AppData\Local\Temp\e5779827b6614358abd7895465015d57
		Packaging modules...
		Checking dotnet version.
		Checking dotnet version.
		3.0.101

		3.0.101

		Creating package project.
		Failed to find the developer pack for .NET Version net472. Your build might fail. You can install the Developer Pack from Microsoft: https://dotnet.microsoft.com/download/visual-studio-sdks
		Using .NET Framework version: net472
		  Restore completed in 227.28 ms for C:\Users\User1\AppData\Local\Temp\e5779827b6614358abd7895465015d57\ReportFetch_ReclaimationTool.csproj.

		  Restore completed in 227.28 ms for C:\Users\User1\AppData\Local\Temp\e5779827b6614358abd7895465015d57\ReportFetch_ReclaimationTool.csproj.

		Packaging C:\Users\User1\AppData\Local\Temp\ReportFetch_ReclaimationTool.ps1 -> E:\IMP Scripts and Files Share SYNCED\New_Scripts_2019\Reclaim_Hybrid_Project\ReportFetch_ReclaimationTool\ReportFetch_ReclaimationTool\bin\Debug\ReportFetch_ReclaimationTool.exe
		Microsoft (R) Build Engine version 16.3.2+e481bbf88 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 61.36 ms for C:\Users\User1\AppData\Local\Temp\e5779827b6614358abd7895465015d57\ReportFetch_ReclaimationTool.csproj.
C:\Program Files\dotnet\sdk\3.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(348,5): warning NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows desktop applications. 'UseWpf' and 'UseWindowsForms' are not supported by the current SDK. [C:\Users\User1\AppData\Local\Temp\e5779827b6614358abd7895465015d57\ReportFetch_ReclaimationTool.csproj]
  ReportFetch_ReclaimationTool -> E:\IMP Scripts and Files Share SYNCED\New_Scripts_2019\Reclaim_Hybrid_Project\ReportFetch_ReclaimationTool\ReportFetch_ReclaimationTool\bin\Debug\ReportFetch_ReclaimationTool.exe

Build succeeded.

C:\Program Files\dotnet\sdk\3.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(348,5): warning NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows desktop applications. 'UseWpf' and 'UseWindowsForms' are not supported by the current SDK. [C:\Users\User1\AppData\Local\Temp\e5779827b6614358abd7895465015d57\ReportFetch_ReclaimationTool.csproj]
    1 Warning(s)
    0 Error(s)

Time Elapsed 00:00:04.71

		Microsoft (R) Build Engine version 16.3.2+e481bbf88 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 61.36 ms for C:\Users\User1\AppData\Local\Temp\e5779827b6614358abd7895465015d57\ReportFetch_ReclaimationTool.csproj.
C:\Program Files\dotnet\sdk\3.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(348,5): warning NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows desktop applications. 'UseWpf' and 'UseWindowsForms' are not supported by the current SDK. [C:\Users\User1\AppData\Local\Temp\e5779827b6614358abd7895465015d57\ReportFetch_ReclaimationTool.csproj]
  ReportFetch_ReclaimationTool -> E:\IMP Scripts and Files Share SYNCED\New_Scripts_2019\Reclaim_Hybrid_Project\ReportFetch_ReclaimationTool\ReportFetch_ReclaimationTool\bin\Debug\ReportFetch_ReclaimationTool.exe

Build succeeded.

C:\Program Files\dotnet\sdk\3.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(348,5): warning NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows desktop applications. 'UseWpf' and 'UseWindowsForms' are not supported by the current SDK. [C:\Users\User1\AppData\Local\Temp\e5779827b6614358abd7895465015d57\ReportFetch_ReclaimationTool.csproj]
    1 Warning(s)
    0 Error(s)

Time Elapsed 00:00:04.71

========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

I see this as well but it’s not affecting my executable. Can you let me know what’s happening with your form?

Hi Adam,

Form Hangs if any error is thrown while running any backend script. Try Catch does not execute to Display error.

Now I am getting error while building any solution: Version 5.10.02
Is there any setting that need to be checked ?

------ Build started: Project: PowerShellProject4, Configuration: Debug Any CPU ------
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\PowerShell Tools for Visual Studio\PowerShellProTools.targets(4,5): error MSB4018: The "PowerShellPackageTask" task failed unexpectedly.
System.ArgumentNullException: Value cannot be null.
Parameter name: source
   at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)
   at PowerShellToolsPro.MsBuild.PowerShellPackageTask.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
Done building project "PowerShellProject4.pssproj" -- FAILED.

Build FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Can you share your PS1 files and PSSProj file?

Hi Adam,

I have uploaded the files to GD and Shared over Message.

I tried installing some older versions of the modules, an extension older than 5.9.10 is generating exes and no errors. Haven’t tried Executing applications yet. I got settled on 5.9.9

Strange. Thanks for the info and the project files. I’ll see if I can get to the bottom of this.

Hello, I too am getting the same problem as afaque01;

------ Build started: Project: REMOVED, Configuration: Debug Any CPU ------
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\PowerShell Tools for Visual Studio\PowerShellProTools.targets(4,5): error MSB4018: The "PowerShellPackageTask" task failed unexpectedly.
System.ArgumentNullException: Value cannot be null.
Parameter name: source
   at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)
   at PowerShellToolsPro.MsBuild.PowerShellPackageTask.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
Done building project "REMOVED.pssproj" -- FAILED.

I have not had this issue in the past, I even went back to a previous project which did work a few weeks ago and encountered the same error message on that too. It appears to have been introduced by a recent change?

Thanks,

It does look that way. I’ve opened this an issue for this and have slated it for the 2021.9.0 release: Build Error when using Visual Studio · Issue #360 · ironmansoftware/issues · GitHub

Great thanks - do you know when build 2021.9.0 is likely to be released? Thanks

We are releasing the second Tuesday of each month so this fix will be available on September 14th.

In the mean time, it sounds like version 5.9.9 does not exhibit this problem. Here’s some info on how to get a hold of the previous version: Installation and Licensing - PowerShell Pro Tools