1
Vote

does not work when winforms assemblies are referenced in target

description

The method TryAssemblyLoadFrom in class CreateReportStructure assumes all assemblies that are to be ReflectionOnlyLoaded end with file extension ".dll".
Suggestion: implement simple fallback to probe for file extension ".exe" in case ".dll" was unsuccessfull.
string loadfrom = s + Path.DirectorySeparatorChar + dependancy.Name;
                    try
                    {
                        if (File.Exists(loadfrom + ".dll"))
                        {
                            assembly = Assembly.ReflectionOnlyLoadFrom(loadfrom + ".dll");
                            break;
                        }
                        if (File.Exists(loadfrom + ".exe"))
                        {
                            assembly = Assembly.ReflectionOnlyLoadFrom(loadfrom + ".exe");
                            break;
                        }
                    }

comments