dotnet run does not work on osx using netXXX TargetFramework
See original GitHub issueOn Mac–> 10.13.3
Steps to reproduce
dotnet new console -o myApp
change myApp.csproj to be
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net451</TargetFramework>
</PropertyGroup>
</Project>
dotnet run
Expected behavior
You see Hello World printed out
Actual behavior
System.ComponentModel.Win32Exception (0x80004005): Permission denied
at Interop.Sys.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Microsoft.DotNet.Cli.Utils.Command.Execute()
at Microsoft.DotNet.Tools.Run.RunCommand.Start()
at Microsoft.DotNet.Tools.Run.RunCommand.Run(String[] args)
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
Environment data
dotnet --info
output:
.NET Command Line Tools (2.1.4)
Product Information:
Version: 2.1.4
Commit SHA-1 hash: 5e8add2190
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.13
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/2.1.4/
Microsoft .NET Core Shared Framework Host
Version : 2.0.5
Build : 17373eb129b3b05aa18ece963f8795d65ef8ea54
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Cannot run .NET Core app in command line on Mac
1 Answer 1 ... Your project has a reference to .NET Framework v4.7 which is incompatible on the OS you are running. You...
Read more >NETSDK1045: The current .NET SDK does not support ...
Open the Solution Properties window (ctrl-click the solution in the Solution window and select Properties), select Build - General, and uncheck ...
Read more >Install .NET on macOS
In this article, you'll learn how to install .NET on macOS. .NET is made up of the runtime and the SDK. The runtime...
Read more >dotnet run command - .NET CLI
The dotnet run command provides a convenient option to run your application from the source code.
Read more >Select which .NET version to use
NET CLI must choose an SDK version for every dotnet command. It uses the latest SDK installed on the machine by default, even...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I built a dotnet tool to address this issue. https://github.com/TheAngryByrd/dotnet-mono
I’ve tried to align it with the same flags so you should just be able to
dotnet mono -f net451 -- --MyProgramFlags
Closing this issue as this is not something we are looking to natively support in the CLI at the moment.