-1

I would like to run a console app from a USB drive. I have the project, the installation files, the deployable folder, and the starting .bat files all on the USB drive. The machine has the proper version of .NET to run the project but when the console app gets called the cmd window says "You must install .NET to run this application". Could I be getting this error because the working directory of the batch is on the USB Drive so the search for .NET fails?

Ideally when I click the start .bat (contained on the USB) it calls the executable in the deployable folder (USB) and passes it args which then installs the software (.exe or .msi contained on the USB but INSTALLING to the machine).

  • 1
    What runtime does your app target? If it's .Net Core/5+, can you make it self contained? Does your installer need a different version of .Net installed than your app? – gunr2171 Nov 17 '22 at 15:09
  • The app targets net6.0, I am investigating making it self contained. The app installs adobe, zoom and more. The .net version that the app uses and the .net that is installed on the target machine are the same. – bselleck Nov 17 '22 at 17:08
  • Thank you gunr2171, making the app self contained allowed our batch scripts to launch the .exe without issue! – bselleck Nov 17 '22 at 17:25

1 Answers1

0

Gunr2171 suggested making the console app self contained. Using the docs found here https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview?tabs=vs we successfully published into a single file and it worked wonderfully!