0

I'm having reference errors when running my asp core 2 web application. My web (core 2) project is referencing another (.dll output) project (.net 4.7) which has Windsor.Core and windsor.castle nuget packages installed. When running the web project, I get the following error:

System.IO.FileNotFoundException: 'Could not load file or assembly 'Castle.Windsor, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc'. The system cannot find the file specified.'

Both projects are targeting x64 (needed for another library). The properties of the Windsor.Core and castle dll's:

enter image description here enter image description here

The Windsor libraries are added to the .dll project only. When I also add the same nuget packages to the asp.net core project, the program crashes with following message:

System.MissingMethodException: 'Method not found: 'Castle.MicroKernel.Registration.IWindsorInstaller Castle.Windsor.Installer.FromAssembly.This()'.'

which to me, seems like only a part of the library is loaded.

Both Windsor.Castle / Core libraries can be found in the output directory of the asp.net core 2 web application. But why can't it find it?

Nick Peelman
  • 145
  • 1
  • 11
  • 3
    read this https://stackoverflow.com/questions/44771733/net-core-could-not-load-file-or-assembly –  Jul 15 '18 at 12:16
  • 1
    Possible duplicate of [.NET Core - Could not load file or assembly](https://stackoverflow.com/questions/44771733/net-core-could-not-load-file-or-assembly) – Neil Jul 15 '18 at 15:01

1 Answers1

0

User AsifAli72090 was right, I also thought something like that would be the problem but my google results didn't give me that answer.

I fixed the problem by creating a new .net core dll project in my solution and moved all of my files to there. You can google on how to convert to a .net core project, but it's not as easy as checking or switching a dropdown in the settings. Everything worked flawlessly then!

Nick Peelman
  • 145
  • 1
  • 11