Hi,
I have a simple question. Is it possible to have 2 differents plugins using the same third-party assembly in 2 different versions? For example: the "plugin A" with a.dll (version 1.0.0) and "plugin B" with a.dll (version 1.1.0) ?
Thanks
private static bool IsAlreadyLoaded(FileInfo fileInfo)
{
//compare full assembly name
try
{
var fileAssemblyName = AssemblyName.GetAssemblyName(fileInfo.FullName);
foreach (var a in AppDomain.CurrentDomain.GetAssemblies())
{
if (a.FullName.Equals(fileAssemblyName.FullName, StringComparison.InvariantCultureIgnoreCase))
return true;
}
}
catch (Exception exc)
{
Debug.WriteLine("Cannot validate whether an assembly is already loaded. " + exc);
}
return false;
//do not compare the full assembly name, just filename
//try
//{
// string fileNameWithoutExt = Path.GetFileNameWithoutExtension(fileInfo.FullName);
// if (fileNameWithoutExt == null)
// throw new Exception(string.Format("Cannot get file extnension for {0}", fileInfo.Name));
// foreach (var a in AppDomain.CurrentDomain.GetAssemblies())
// {
// string assemblyName = a.FullName.Split(new[] { ',' }).FirstOrDefault();
// if (fileNameWithoutExt.Equals(assemblyName, StringComparison.InvariantCultureIgnoreCase))
// return true;
// }
//}
//catch (Exception exc)
//{
// Debug.WriteLine("Cannot validate whether an assembly is already loaded. " + exc);
//}
//return false;
}
<dependentAssembly>
<assemblyIdentity name="AutoMapper" publicKeyToken="be96cd2c38ef1005" culture="neutral" />
<codeBase version="6.1.1.0" href="Plugins\Integration.ServiceBus\AutoMapper.dll" />
<codeBase version="4.1.1.0" href="bin\AutoMapper.dll" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
<codeBase version="1.25.0.0" href="Plugins\Nop.Plugin.Seurata.GoogleShopping\Google.Apis.dll" />
<bindingRedirect oldVersion="0.0.0.0-1.25.0.0" newVersion="1.25.0.0" />
</dependentAssembly>