How can I coax LPRun (any version) to run within Azure App Services' Kudu/SCM?
I'd like to use LPRun to run some LinqPad scripts for more complex housekeeping tasks in Azure App Services that would be far too painful to write in .cmd or PowerShell.
However, LPRun doesn't seem to want to run:
(Yes, I've read the bundled Help! LINQPad won't start!.txt readme files; but despite the restrictions in the Azure App Service sandbox (rsfilter.sys, fyi), the full dotnet environment is ostensibly available, hence why I'm unsure of the exact cause of all these errors (below) about LPRunN.exe not finding any installed versions of dotnet.
LinqPad 5 LPRun.exe:
C:\home\site\Utility\LPRun\LPRun5>LPRun.exe IOException: The handle is invalid. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.__Error.WinIOError() at System.Console.set_InputEncoding(Encoding value) at LINQPad.Cmd.LPCmd.Run(String[] args) C:\home\site\Utility\LPRun\LPRun5>
LinqPad 6 LPRun6.exe:
C:\home\site\Utility\LPRun\LPRun6>lprun6.exe You must install or update .NET to run this application. App: C:\home\site\Utility\LPRun\LPRun6\LPRun6.exe Architecture: x64 Framework: 'Microsoft.WindowsDesktop.App', version '3.1.0' (x64) .NET location: C:\Program Files\dotnet No frameworks were found. Learn more: https://aka.ms/dotnet/app-launch-failed To install missing framework, download: https://aka.ms/dotnet-core-applaunch?framework=Microsoft.WindowsDesktop.App&framework_version=3.1.0&arch=x64&rid=win-x64&os=win10 C:\home\site\Utility\LPRun\LPRun6>
LinqPad 6 LPRun6-net5.exe:
C:\home\site\Utility\LPRun\LPRun6>LPRun6-net5.exe You must install or update .NET to run this application. App: C:\home\site\Utility\LPRun\LPRun6\LPRun6-net5.exe Architecture: x64 Framework: 'Microsoft.WindowsDesktop.App', version '5.0.0' (x64) .NET location: C:\Program Files\dotnet No frameworks were found. Learn more: https://aka.ms/dotnet/app-launch-failed To install missing framework, download: https://aka.ms/dotnet-core-applaunch?framework=Microsoft.WindowsDesktop.App&framework_version=5.0.0&arch=x64&rid=win-x64&os=win10
LinqPad 8 LPRun8.exe and LinqPad 8 LPRun8-x86.exe:
(Same output for both)
C:\home\site\Utility\LPRun\LPRun8>LPRun8-x86.exe Directory 'C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App' does not exist. LINQPad 8 requires .NET 9, .NET 8, .NET 7 or .NET 6 (Desktop) to run. Run 'Download .NET.exe' to install.
LinqPad 9 LPRun9.exe and LinqPad 9 LPRun9-x86.exe:
(Same output for both)
C:\home\site\Utility\LPRun\LPRun9>lprun9 Directory 'C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App' does not exist. LINQPad 9 requires .NET 10, .NET 9 or .NET 8 (Desktop) to start up. Run 'Download .NET.exe' to install.
Answers
-
lprun targets .NET Desktop which isn't installed on Azure App Services. This is to allow scripts to access .NET Desktop features and ensure that they don't fail to compile if there are any desktop dependencies (whether or not desktop features are used).
To make this work with .NET Core, I would need to make lprun dynamically target either .NET Desktop or .NET Core depending on what was installed. It could be done - it would require some tricky C++ work and a lot of testing.
