2

I have a very simple .net Core (2.1) console application that uses a couple of NuGet packages for development. When I compile (not self-contained) it's output is as follows:

HelloWorld.deps.json 
HelloWorld.dll 
HelloWorld.pdb 
HelloWorld.runtimeconfig.dev.json 
HelloWorld.runtimeconfig.json

NOTE: for the sake of simplicity, I've renamed the app output to HelloWorld

If I run the console app using the following command:

dotnet HelloWorld.dll

I get the following output:

Error: An assembly specified in the application dependencies manifest (HelloWorld.deps.json) was not found: package: 'Microsoft.Azure.Amqp', version: '2.3.0' path: 'lib/netstandard1.3/Microsoft.Azure.Amqp.dll'

I understand that it's missing one of the assemblies referenced via NuGet during development. As this is NOT a self-contained app and expects the .net Core Runtime or SDK on the machine it's running, how do I ensure the other required dll's are there? I would have expected that any non dotnet core dll's would have been in the compiled output but they arent.

Thanks for any pointers in advance! (I'm new to running .net Core on Ubuntu)

Rob
  • 6,819
  • 17
  • 71
  • 131
  • Is this happening only on Production Environment or on dev as well? – Severin Jaeschke Aug 20 '18 at 08:20
  • I'm only as far as Dev at the moment - does that have any bearing on the problem though? – Rob Aug 20 '18 at 08:22
  • 1
    Have a look at [this](https://stackoverflow.com/a/48897649/8471295) answer and [this](https://stackoverflow.com/questions/40108106/using-external-dll-in-dot-net-core) Thread. Yes it does, since runtime and sdk do have differencies especially when it comes to loading of dlls. – Severin Jaeschke Aug 20 '18 at 08:25

1 Answers1

1

I quickly realised what I had done! I had copied the output of the /bin/ directory of my project and tried to run that. What I actually should have done is copy the output from a "Publish", which includes everything the application needs! Doh! :)

Rob
  • 6,819
  • 17
  • 71
  • 131