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.

dotnet run app.dll throws null reference exception

See original GitHub issue

Steps to reproduce

  1. build a console app.
  2. run dotnet publish
  3. navigate to the publish folder
  4. run dotnet run app.dll

Expected behavior

An error indicating that to use dotnet on a dll you shoud do dotne app.dll

Actual behavior

Object reference not set to an instance of an object.

Environment data

dotnet --info output: .NET Command Line Tools (1.0.0-rc2-002611)

Product Information: Version: 1.0.0-rc2-002611 Commit Sha: bf8f0edd89

Runtime Environment: OS Name: ubuntu OS Version: 14.04 OS Platform: Linux RID: ubuntu.14.04-x64

Other info “dependencies”: { “Microsoft.NETCore.App”: { “version”: “1.0.0-rc2-24008”, “type”: “platform” }, “Microsoft.AspNetCore.Server.IISIntegration”: “1.0.0-rc2-20581”, “Microsoft.AspNetCore.Server.Kestrel”: “1.0.0-rc2-20581” },

“frameworks”: { “netcoreapp1.0”: { “imports”: [ “dotnet5.6”, “dnxcore50”, “portable-net45+win8” ] } }

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Sebazzzcommented, May 20, 2016

Perhaps this can be clarified in documentation. I was trying to run my published app using dotnet run, only to find out now it should be run using dotnet filename.dll. Never mind, it shouldn’t crash with such a vague error message. I haven’t tried the preview2 bits yet though.

0reactions
blackdwarfcommented, Jan 28, 2017

This has been added to the documentation now (e.g. https://docs.microsoft.com/en-us/dotnet/articles/core/tools/dotnet-run). Closing. Since the issue is by design, if the docs need more clarification, feel free to open the issue on dotnet/docs repo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting a NullReferenceException when using dotnet run
In most cases code that throws a NullReferenceException has a bug. It assumed something was not null when in fact it was null....
Read more >
How can I fix the error: System.NullReferenceException
A NullReferenceException exception is thrown when you try to access a member on a type whose value is null. A NullReferenceException exception ...
Read more >
Object Reference Not Set to an Instance of an Object
This exception is thrown when you try to access a member—for instance, a method or a property—on a variable that currently holds a...
Read more >
Issues with System.NullReferenceException occurrence ...
NET Core 3.1 is breaking when starting the web application because of a NullReferenceException, but this one is thrown in the IISHttpServer.
Read more >
Debugging System.NullReferenceException - elmah.io Blog
The exception happens when you try to invoke a reference that you were expecting to point to an object but in fact, points...
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