question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow running simple .exe files without .runtimeconfig.json

See original GitHub issue

It is currently impossible to execute simple console applications (.exe) compiled against net472 using dotnet myapp.exe.

The output we get is something along these lines:

Cannot use file stream for [/Users/builder/azdo/_work/1/s/setup/MacSetup/build/packages/binarycompatchecker/1.0.20/tools/BinaryCompatChecker.deps.json]: No such file or directory
A fatal error was encountered. The library 'libhostpolicy.dylib' required to execute the application was not found in '/Users/builder/azdo/_work/1/s/setup/MacSetup/build/packages/binarycompatchecker/1.0.20/tools/'.
Failed to run as a self-contained app.
The application was run as a self-contained app because '/Users/builder/azdo/_work/1/s/setup/MacSetup/build/packages/binarycompatchecker/1.0.20/tools/BinaryCompatChecker.runtimeconfig.json' was not found.
If this should be a framework-dependent app, add the '/Users/builder/azdo/_work/1/s/setup/MacSetup/build/packages/binarycompatchecker/1.0.20/tools/BinaryCompatChecker.runtimeconfig.json' file and specify the appropriate framework.

This is not user friendly at all. The expectation is that for most programs compiled against net472 they should just run by prepending dotnet. Forcing to add a .runtimeconfig.json sounds like a sound requirement in theory, but in practice this adds friction to the 90% case (simplest scenario).

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:11
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
KirillOsenkovcommented, Oct 29, 2021

Just pick the latest available Core runtime and hope for the best. There are situations where you have an existing tool compiled for net472 that you want to run on Mac. You can run on Mono without problems, but you can’t run on dotnet for an artificial reason/limitation.

I don’t think dotnet some.exe should work for native binaries, but that’s not the scenario I care about. In 90% cases you can run .NET Framework apps just fine if you manually add a .runtimeconfig.json file. I think it’s silly to have this artificial impediment.

1reaction
abatishchevcommented, Oct 29, 2021

And the other cases?

Doesn’t matter. If in 90% it’ll work - it’s already a huge win for the customers.

Following this logic, nothing needs any improvement ever if there will be always a corner case which won’t be fixed/improved.

Catering to ~90% of customers sounds to me like a good reason for a change.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I run a WPF .NET3.1 app without app.dll and app. ...
runtimeconfig.json. Basically I only want to pass the app.exe file only from the debug folder to someone also on Windows 10 and Windows...
Read more >
NET Runtime configuration settings
json file exists in the same folder as the project file, any configuration options it contains are inserted into the [appname].runtimeconfig.
Read more >
Deep-dive into .NET Core primitives: deps.json ...
I learned to program with gcc, C++, and vim. When I started working with C# and .NET, clicking the “Start” button in Visual...
Read more >
Question about compiling .NET Core to single file : r/csharp
If I run the .exe it will run the program. ... the application will not run without the other files present in the...
Read more >
"You must install .NET Desktop Runtime 6.0.4 (x64)" error
I was able to launch the application by including the runtimeconfig.json file. With .NET Framework applications, it was possible to simply copy ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found