We are currently evaluating the PowerShellProTools PowerShell module in order to package a PowerShell Core script into a self-contained executable for Linux.
We installed the .NET SDK (3.1.301) and PowerShell Core (7.0.2) on an Ubuntu machine. Next up we tried to run the following command:
Merge-Script -Verbose -Config @{
>> Root = "/home/dr/My.ps1"
>> OutputPath = "/home/dr/My"
>> Package = @{
>> Enabled=$True
>> PowerShellCore=$True
>> }
>> Bundle = @{
>> Enabled=$True
>> Modules=$True
>> }
>> }
It starts working, but fails with:
/usr/share/dotnet/sdk/3.1.301/Microsoft.Common.CurrentVersion.targets(1177,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.6.2 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [/tmp/bf3bf0c9032740e2b325b3c7638b90d3/My.csproj]
0 Warning(s)
1 Error(s)
Of course we can’t install the .NET Framework 4.6.2 on Linux, we don’t even know why it is trying to use .NET 4.6.2 when we’ve installed .NET Core only.
Can you help us?
Best regards,
D.R.