I wrote a custom AssemblyResolve method to handle assembly in a folder other than exe file. But once it shows missing "Microsoft.Practices.EnterpriseLibrary.Common.resources". While I have Microsoft.Practices.EnterpriseLibrary.Common.dll, I don't have Microsoft.Practices.EnterpriseLibrary.Common.resources.dll. How do i manually load Microsoft.Practices.EnterpriseLibrary.Common.resources?
protected Assembly ConfigResolveEventHandler(object sender, ResolveEventArgs args)
{
//This handler is called only when the common language runtime tries to bind to the assembly and fails.
//Retrieve the list of referenced assemblies in an array of AssemblyName.
string strTempAssmbPath = "";
Assembly asm = this.GetType().Assembly;
var uri = new Uri(Path.GetDirectoryName(asm.CodeBase));
Assembly objExecutingAssemblies = Assembly.GetExecutingAssembly();
AssemblyName[] arrReferencedAssmbNames = objExecutingAssemblies.GetReferencedAssemblies();
//Loop through the array of referenced assembly names.
if (arrReferencedAssmbNames.Any(strAssmbName => strAssmbName.Name == args.Name))
{
strTempAssmbPath = Path.Combine(uri.LocalPath, args.Name) + ".dll";
}
//Load the assembly from the specified path.
Assembly myAssembly = Assembly.LoadFrom(strTempAssmbPath);
//Return the loaded assembly.
return myAssembly;
}
Microsoft.Practices.EnterpriseLibrary.Common.dlllibrary, and maybe for whatever reason those can't be accessed. Looking at it in .NET Reflector, it lists the references, andMicrosoft.Practices.EnterpriseLibrary.Common.resources.dllis not listed. Have you had any luck with this yet?