assembly.reflectiononly

Method does not have an implementation when loading assemblies into a new AppDomain in ReflectionOnly mode

馋奶兔 提交于 2019-12-12 12:19:53
问题 In our application (solution with 65 projects), all referenced assemblies are analysed in run-time for the presence of Ninject modules (there is some filtering applied too). The modules are loaded later into the Ninject kernel and each module declares bindings for the kernel. We have adopted a loader that loads the referenced assemblies into a separate assembly in reflection only mode. The difference from the way Ninject can load assemblies from the directory is that the directory can contain

Weird FileLoadException when loading assembly referenced by WPF project using Assembly.ReflectionOnlyLoadFrom

孤街醉人 提交于 2019-12-10 18:16:30
问题 I have a custom MSBuild task that peeks inside an assembly to get some attribute meta-data. Assembly assembly = Assembly.ReflectionOnlyLoadFrom(AssemblyFile) This is used by our automated build/release process, and has been working perfectly against assemblies used by and referenced from class libraries, console apps and web projects. The MSBuild task is called after another MSBuild process has compiled the projects. It stopped working yesterday when I added a WPF project which referenced

C# Assembly.Load vs Assembly.ReflectionOnlyLoad

天大地大妈咪最大 提交于 2019-12-03 05:23:49
问题 I'm trying to understand the differences between Assembly.Load and Assembly.ReflectionOnlyLoad. In the code below I am attempting to find all of the objects in a given assembly that inherit from a given interface: var myTypes = new List<Type>(); var assembly = Assembly.Load("MyProject.Components"); foreach (var type in assembly.GetTypes()) { if (type.GetInterfaces().Contains(typeof(ISuperInterface))) { myTypes.Add(type); } } This code works fine for me, but I was doing some research into

C# Assembly.Load vs Assembly.ReflectionOnlyLoad

半世苍凉 提交于 2019-12-02 17:51:34
I'm trying to understand the differences between Assembly.Load and Assembly.ReflectionOnlyLoad. In the code below I am attempting to find all of the objects in a given assembly that inherit from a given interface: var myTypes = new List<Type>(); var assembly = Assembly.Load("MyProject.Components"); foreach (var type in assembly.GetTypes()) { if (type.GetInterfaces().Contains(typeof(ISuperInterface))) { myTypes.Add(type); } } This code works fine for me, but I was doing some research into other possibly better alternatives and came across Assembly.ReflectionOnlyLoad() method. I assumed that