Doing this:
var _partsCatalog = new DirectoryCatalog(directoryName);//Fully qualified path to our bin folder
var partInfos = partsCatalog
.Parts
.Select(pd => new PartDefinitionInfo(pd))
.ToArray(); <<-- this throws
Throws an exception : “Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.” with the LoaderExceptions set to :
{“Could not load file or assembly ‘Facebook, Version=5.4.1.0,
Culture=neutral, PublicKeyToken=58cb4f2111d1e6de’ or one of its
dependencies. The system cannot find the file specified.”: “Facebook,
Version=5.4.1.0, Culture=neutral, PublicKeyToken=58cb4f2111d1e6de”}
Granted, one of my assemblies is referencing the Facebook.Web.dll , which causes it to be copied into the bin folder, which causes it to be part of the directory catalogue, kinda unintentionally, but stil…
But why would it throw this error?
From the Getting Started guide: “Add references to Facebook.dll and Facebook.Web.dll”. You need to reference both.
The error message says it all: something has a dependency on Facebook.dll, but the .NET runtime was unable to load that dll, because it cannot find it in the bin folder: “The system cannot find the file specified“.