Avatar of Jonathan D.
Jonathan D.
Flag for Israel asked on

Published .NET 6 Program for OSX x64 won't Run on Big Sur

Hey everyone, I have compiled (using Publish method) a framework-dependant program for macOS (osx-x64) as "Single File" which produced three files

.env (file holds settings for program)

Open in new window

These are the only files, my client has installed .NET 6 runtime on his MacBook and can't run the program.

The command he runs is "dotnet AppName" on the target folder. But instead, the tool produces an error:

Could not execute because the specified command or file was not found. Possible reasons for this include: 

* You misspelled a built-in dotnet command. 

* You intended to execute a .NET program, but dotnet-/Users/stephan/Downloads/osx-x64/TicketBot does not exist. 

* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH. 

.NET ProgrammingC#* Mac OSMac OS X

Avatar of undefined
Last Comment
Jonathan D.

8/22/2022 - Mon
Peter Hutchison

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Jonathan D.

Haha yeah Peter, I've come to that conclusion after reading my question. If that is the problem I'll mark your response as the solution. Thanks!

I have to wait for my client to get back to me and see if this resolved his issue, so I'll update you here asap.

Edit: Tell me something Peter, the fact that the compiled file has no extension such as .dll is something that should worry me? I mean, would it still execute with the dotnet command on macOS without an extension? Have I compiled it wrong using publish method or is it normal to be extensionless? Thanks.
Chinmay Patel

Sorry to jump in but it is the default behaviour, if you target MacOS, you will get an extension-less build file.
Jonathan D.

@Chinmay Thank you for confirming this, I will be back with an update next week.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes