ASP .NET CORE could not find file or assembly with custom assembly

Viewed 19111

I've ran into a weird problem.

I basically have my own web-stack for .NET-core which I've built into a few .dlls, and I want to reference these from another ASP CORE-solution.

VS seems to find the assemblies, where I can navigate types etc. I can also build the project without any issues, but when IIS then runs the server I get an internal server error stating:

FileNotFoundException: Could not load file or assembly 'myDLL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

The referenced DLLs are in the debug-folder, and the really weird thing is that if I create a new ASP Core project in the same solution as the web-stack, I can reference and use it without any problems.

Why is this happening only when running on a project outside the web-stack's solution, and what can I do to make it runnable everywhere?

2 Answers

for load the external dll in core project, needed to:

  1. vs 2017 with version 15.3 or upper.
  2. Microsoft.Extensions.DependencyModel NuGet package installed in your project.
Related