Questions tagged [assembly.reflectiononly]
12 questions
49
votes
5 answers
C# Assembly.Load vs Assembly.ReflectionOnlyLoad
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…

Max Schilling
- 2,891
- 4
- 25
- 28
8
votes
3 answers
Why is ReflectionOnlyAssemblyResolve not executed when trying to Assembly.ReflectionOnlyLoad?
I'm trying to load a few modules via hooking into the AppDomain.AssemblyResolve and AppDomain.ReflectionOnlyAssemblyResolve events. While I got the former to work, I fail miserably on the latter. I've boiled my problem down to this little…

David Schmitt
- 58,259
- 26
- 121
- 165
7
votes
2 answers
Getting types in mscorlib 2.0.5.0 (aka Silverlight mscorlib) via reflection on?
I am trying to add Silverlight support to my favorite programming langauge Nemerle.
Nemerle , on compilation procedure, loads all types via reflection mainly in 2 steps
1-) Uses Assembly.LoadFrom to load assembly
2-) Usese Assembly.GetTypes() to…

user67754
- 241
- 2
- 6
5
votes
3 answers
Method does not have an implementation when loading assemblies into a new AppDomain in ReflectionOnly mode
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…

Karel Frajták
- 4,389
- 1
- 23
- 34
3
votes
1 answer
System.PlatformNotSupportedException exception when calling Assembly.ReflectionOnlyLoadFrom
I am using .NET Core 2.1 to load an assembly calling Assembly.ReflectionOnlyLoadFrom(...) but am getting a System.PlatformNotSupportedException exception. Microsoft documentation seems to indicate that it should work. Has this been implemented? If…

Jarrell
- 31
- 1
- 2
3
votes
0 answers
C# How light is Assembly.ReflectionOnlyLoad
I have a number of assemblies which I treat as libraries in my Unity game. When the game starts, I want to quickly read just the manifest of all files - there may be some 50+ at some point in the future - and make a list in memory.
I have packed…

safe_malloc
- 824
- 2
- 12
- 29
3
votes
1 answer
Weird FileLoadException when loading assembly referenced by WPF project using Assembly.ReflectionOnlyLoadFrom
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…

si618
- 16,580
- 12
- 67
- 84
1
vote
1 answer
Reading the Type details from referenced dll/ assembly
I have two dll files Lets say DataLayer.dll and ProcessLayer.dll. DataLayer.dll has a Class called MyClass like below:
public class MyClass
{
public string name;
public int age;
public string aadhar;
}
and I have refereed DataLayer.dll in second…

Madhuri Lad
- 231
- 1
- 3
- 14
0
votes
0 answers
Different scenarios when a referenced assembly in .NET Core project won't be loaded
I know for example if any type in a referenced assembly is used by the project this assembly won't be loaded.And this reference is used in the build time(for example using a constant in that assembly).Can you please enumerate the different scenarios…

Tahatoun
- 21
- 5
0
votes
2 answers
Cannot reflect over assembly that shares a dependency of different version
Here's the scenario using Assembly.ReflectionOnlyLoadFrom:
Both my assembly Inspected and my reflection Application Inspector reference Assembly Dependency.
If Inspector references Dependency 1.0.0.0 and Inspected references Dependency 1.1.0.0,…

Arne Claassen
- 14,088
- 5
- 67
- 106
0
votes
1 answer
Creating instance with parameters and involking methods from dll
I am loading a dll, creating an instance and want to invoke methods and check return value. I am getting an exception {"Parameter count mismatch."} when creating an instance:
static void Main(string[] args)
{
…

See Blunt
- 11
- 2
-1
votes
1 answer
Get types in assembly: ReflectionTypeLoad Exception
Possible Duplicate:
How to reproducably cause / provoke a ReflectionTypeLoadException?
I wanted to get all types in a loaded assembly.code snippet is as follows
Assembly assemblyObj = Assembly.LoadFile(@"D:\abc\abc.dll");
IList…

Geeta
- 69
- 1
- 8