Questions tagged [system.reflection]

System.Reflection is a namespace of the .NET framework. It contains types that retrieve information about assemblies, modules, members, parameters, and other entities in managed code by examining their metadata.

System.Reflection is a namespace of the .NET framework. It contains types that retrieve information about assemblies, modules, members, parameters, and other entities in managed code by examining their metadata.

References

1116 questions
0
votes
1 answer

EventListeners Not getting called with Instance created through Reflection

Apologies had a typo...have edited... I have a weird issue I am not sure about. In one piece of code I have a class which is called as a singleton which has an event other classes can listen to, pretty straightforward by doing something…
user1772250
  • 319
  • 5
  • 15
0
votes
1 answer

is there any way to search through cs file

I have a requirement to list out the methods in the cs files and list the each method call inside a method . For example : i have a class public void method1 () { c2.M2(); } public void method2 () { c2.m3(); } Here c2 is another class and…
ansar
  • 128
  • 13
0
votes
0 answers

How to read the entire content of satellite assemblies without referring programmatically?

I need to be able to read the contents of satellite assembly when its location given along with its culture info. so, i cant add a reference to this assembly at compile time and i will not know the exact contents of this assembly(i will have to…
0
votes
3 answers

How does Type.Attributes of C# work?

So System.Type has an instance method called Attributes. public TypeAttributes Attributes { get; } which returns an enum of type TypeAttributes. Here are some members of this enum: public enum TypeAttributes { AnsiClass = 0, Class = 0, …
ahmet alp balkan
  • 42,679
  • 38
  • 138
  • 214
0
votes
2 answers

C# Set variable using string that has variable name inside

*Switched over to serailization. Summary: I have all the variables pre-defined as null / 0. I want to set them using data from and XML document. The document contains the exact same names as the variables. I don't want to use a bunch of else ifs so…
Ken Rea
  • 67
  • 8
0
votes
1 answer

Reflection issue

Suppose I have an interface called IVerifier public interface IVerifier { bool Validate(byte[]x, byte[]y); } and I had to load an assembly by reflection, and that assembly holds the same signature, how possible it is to do this: IVerifier c =…
SVI
  • 921
  • 4
  • 11
  • 23
0
votes
1 answer

Ninject causing "Method not found: System.Reflection.MethodInfo.CreateDelegate"

I'm attempting to deploy a website that uses Ninject for DI which works well locally on my development machine. When deployed to GoDaddy hosting, I get the following error: Method not found: 'System.Delegate…
0
votes
1 answer

Reflection loading FAILURE in Sharepoint and SUCCESS in Console

I'm facing a problem loading via refletion my class. this code: PublishingClass = Type.GetType("CONST STRING FULLY QUALIFIED", true); Works if I'm in a console app but fails (Could not Load "CONST STRING FULLY QUALIFIED") if I'm in Sharepoint…
Ziba Leah
  • 2,484
  • 7
  • 41
  • 60
0
votes
1 answer

using lambda to extract member info via System.Reflection

I am trying to use system Reflection to enable extraction of a class member (type int) var CurrTblID = typeof(currProjData).GetMembers( BindingFlags.Public |BindingFlags.Static …
LoneXcoder
  • 2,121
  • 6
  • 38
  • 76
0
votes
1 answer

Get mem address of a Method's body whose assembly is loaded through Assembly.load

I have loaded an assembly B into the appdomain of assembly A using Assembly.load(). B has a method named "X" which i need to retrieve its memory address/pointer. I understand that B is mapped into memory as a single contiguous memory data after…
Ron
  • 67
  • 1
  • 6
0
votes
2 answers

How can I cast a object which is instantiated by reflection to its real type?

Recently I'm developing a tiny framework for myself, and I met this problem: How can I do things like follow: void object CreateDictionary(Type dictionaryType) { object dict = dictionaryType.GetConstructor(new Type[] {}).Invoke(new object[]…
Aetherus
  • 8,720
  • 1
  • 22
  • 36
0
votes
1 answer

c# Winforms how to get the control a property is bound to

I have a variety of Textboxes that are created dynamically on my form, when they are created databindings are added binding the textbox to a property in my class. I need to be able to get a reference to the Textbox however I only know the property…
AlbinoMonkey
  • 11
  • 1
  • 1
0
votes
2 answers

Common CRUD functions with use of reflection C#

Here's my situation, I have to create a common function for inserting values into a MySQL db. So far I have the approach below. This code works fine when there is no composite class within another class. If we have navigational properties in the…
Meson
  • 859
  • 1
  • 9
  • 15
0
votes
1 answer

Reflection does not reflect method in interface in C#

I cannot figure out what the deal is with this code. "command" = Park, and the Park method exists in the interface. "method", however, just equals null, so it throws an exception when I hit invoke. The debugger kicks in, and so I was able to make…
Arlen Beiler
  • 15,336
  • 34
  • 92
  • 135
0
votes
1 answer

Datapoints/FieldNames merging with entity property values using C#

I have an entity class say MyEntity.cs that has around 108 properties. In my ASP .net application UI, I am displaying a string value from the database(say for instance) which contains some fieldnames or datapoints delimited in the format…
SARAVAN
  • 14,571
  • 16
  • 49
  • 70