I've created my own T4 Tempalte in my web project which is loading the used assemblies from my current Solution and creates some files.
That works fine so far. But now I've updated one of my NuGet components to a new version and I've added a assemblyBinding section so that a older version and the newer version of my component work. That works also fine so far for my website itself.
But my T4 template now brings a
The File or Assembly "\xxx...\...." or a dependency could not be found
It seems that my T4 Template is not reading my assemblyBinding section in the web.config is that possible and is there a workaround for this withoug updating my assembly reference in every dependent dll.
I am using T4 Template with a compiled Dll for code Implementation and in my DLL I'am loading my Assemblies, what works fine.
var assemblies = Factory.CreateAssemblyManager().LoadAssemblies(proxySettings.WebProjectName, proxySettings.FullPathToTheWebProject);
And then I'm searching inside every assembly for my custom attribute and here I get the error above, that the file or assembly could not be loaded.
foreach (Assembly assembly in assemblies)
{
var types = assembly.GetTypes().Where(type => type.GetMethods().Any(p => p.GetCustomAttributes(typeof (CreateProxyBaseAttribute), true).Any())).ToList();
}
German Error:
{"Die Datei oder Assembly \"Internal.Xyz.DomainModel, Version=2.1.0.0, Culture=neutral, PublicKeyToken=d72343e09836ed19\" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.":"Internal.Xyz.DomainModel, Version=2.1.0.0, Culture=neutral, PublicKeyToken=d72343e09836ed19"}