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.

Minimal console app unhandled FileNotFoundException

See original GitHub issue

I installed the mac osx pkg installer from get.asp.net. I then created a very minimal hello world console app. I’ve ran dotnet restore which appears to have run successfully. Then when I run dotnet run I get this:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ‘System.Console, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:47 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
loic-sharmacommented, Apr 12, 2016

Hey, seems like this bug is back:

$ dotnet new
Created new project in  /Users/sharmaloic/Code/REPL
$ dotnet restore
Microsoft .NET Development Utility CoreClr-x64-1.0.0-rc1-16231

  CACHE https://api.nuget.org/v3/index.json
Restoring packages for /Users/sharmaloic/Code/REPL/project.json
  GET https://api.nuget.org/v3-flatcontainer/microsoft.netcore.runtime/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.io/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.console/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.runtime/index.json
  OK https://api.nuget.org/v3-flatcontainer/system.io/index.json 300ms
  OK https://api.nuget.org/v3-flatcontainer/microsoft.netcore.runtime/index.json 525ms
  OK https://api.nuget.org/v3-flatcontainer/system.console/index.json 387ms
  OK https://api.nuget.org/v3-flatcontainer/system.runtime/index.json 433ms
Writing lock file /Users/sharmaloic/Code/REPL/project.lock.json
Restore complete, 7195ms elapsed

NuGet Config files used:
    /Users/sharmaloic/.config/NuGet/nuget.config

Feeds used:
    https://api.nuget.org/v3-flatcontainer/
$ dotnet run

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Console, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
$ dotnet build

Unhandled Exception: System.ComponentModel.Win32Exception: No such file or directory
   at System.Diagnostics.Process.ResolvePath(String filename)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at Microsoft.DotNet.Cli.Utils.Command.Execute()
   at Microsoft.DotNet.Cli.Program.Main(String[] args)
Abort trap: 6
$ dotnet restore --runtime osx.10.10-x64
   ....
$ dotnet run
Hello World!

I’m on El Capitan 10.11 and freshly installed the .NET Core SDK Installer linked in the readme.

0reactions
blackdwarfcommented, Dec 4, 2016

@dlech good, glad to see you’re back on track. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Minimal console app unhandled FileNotFoundException
I've ran dotnet restore which appears to have run successfully. Then when I run dotnet run I get this: Unhandled Exception: System.IO.
Read more >
An unhandled exception of type 'System.IO. ...
I'm developing a C# application and I get the following error at debug runtime: An unhandled exception of type 'System.IO.FileNotFoundException' ...
Read more >
How to Handle the FileNotFoundException in C# | Rollbar
The FileNotFoundException occurs in C# when the system is unable to locate a file when the program is executed. Learn how to handle...
Read more >
how to solve Break Mode (An unhandled exception of type ' ...
In this case it was an unhandled exception (error). Fortunately the debugger will show you the line of code it is failing on...
Read more >
How to resolve “Could not load file or assembly … or one of its ...
LOG: Using application configuration file: F:\visual studio 2017\Projects\TestBindingApp\TestBindingApp\bin\Debug\TestBindingApp.exe.
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