I need a tool that can dump the referenced types used by an assembly in a machine readable format.
e.g. this Code in assembly 'dummy.exe'
static void Main()
{
Console.WriteLine("Hello World");
}
would produce something like
<references assembly="dummy.exe">
<mscorlib>
<System.Console>
<WriteLine/>
...
Can you do this...
Hello
I am writing a Junit test framework to test web services.
There is a requirement for the input values to come from many different sources, eg an earlier web service call or literals within the class.
To achieve this I have constructors that accept the different inputs in different ways; all simple so far.
The problem is the web...
I came to know that using Reflection we can create objects without using "new" keyword. So I wanted to know are there any differences in them or any particular scenarios to use Reflection. Because till now i didnt create or seen any of the code creating object with reflection.
Why using 'new' became so used and reflection not.
...
Hello,
I have an application with a server "AppDomain", which accepts calls from separate AppDomains (which host plugins, developed by other people and not trustworthy).
From the server AppDomain, I need to know which "Plugin" (AppDomain) is actually making the call, so that I can ensure that this plugin has access to the resource.
I ...
Suppose I want to write a function, which will create a HashMap from some specified type T to String, for example, a HashMap from Integer to String as follows:
HashMap<Integer, String> myHashMay = new HashMap<Integer, String>();
I want to have flexibilty to specify the type T. So I write a function as:
void foo(Class<?> myClass) {
...
I used reflection to look at the internal fields of System.String and I found three fields:
m_arrayLength
m_stringLength
m_firstChar
I don't understand how this works.
m_arrayLength is the length of some array. Where is this array? It's apparently not a member field of the string class.
m_stringLength makes sense. It's the le...
Is their an equivalent to C#'s Expression API in scala?
For example, I would like to have a lambda like this:
(Foo) => Foo.bar
and be able to access "bar" in the function it is passed to.
...
I have a listbox to which I have bound the data context to an object. This object has a number of properties some of which will have a particular attribute.
What I want to do from this is to have the items source set to the properties of the object but to only display those properties that have a particular attribute set.
Can anyone he...
You should all have noticed if you right click a file in the windows explorer, there is a tab named Details. Is there any trick to get these properties, and specifically the product name, whether this is a .NET file or not, over C#?
Thank you.
...
I would like to know if it is possible to get all the objects running from an application/assembly/appdomain of a specific type...
I don't think reflection would help in this case as I need an object before hand. However, I want to got the other way: from a type I want all the objects created from it.
Is this possible with .Net?
...
If I have a class called MyProgram is there a way of retrieving "MyProgram" as a string?
...
There is a specific class in a third party library that I want to serialize. How would I go about doing this?
I'm assuming I will have to write a method that takes in an object of the class and uses reflection to get the private member values. Then for deserialization I would use reflection to put the values back.
Would this work...
I'm trying to create a nUnit test to do the following:
1) Load the DLL to test.
2) Iterate among the various types.
3) Find the ones that have a certain custom attribute.
4) Instantiate these types and make sure that all their public properties aren't null.
Here's what I wrote so far:
Assembly assembly = Assembly.LoadFile("MyLib.dll...
Hi.
I have a class and i want to find all of it's public variables (not functions). how can i do so?
thanks!
...
Hi Everyone,
I get the class name and method name as well as parameters via query string. I don't know what is coming so I can't say lets create this instance or that instance to pass it MethodInfo Invoke method so I need a generic solution. Here is the problem :
string className = Request.QueryString["className"];
string actionMethod...
Hey there
I need to execute a method in an assembly loaded during runtime. Now I want to unload those loaded assemblies after the method call. I know that I need a new AppDomain so I can unload the libraries. But here, the problem arises.
The assemblies going to load are plugins in my plugin framework. They have no entry point at all. ...
I have an instance of System.Type that represents an interface, and I want to get a list of all the properties on that interface -- including those inherited from base interfaces. I basically want the same behavior from interfaces that I get for classes.
For example, given this hierarchy:
public interface IBase {
public string Base...
I'm looking for a way to ensure that method 'A' calls method 'B'. So roughly, the deal is..
class one
{
internal static void MethodA()
{
//Do Something here. SHOULD be calling B.
}
void MethodB()
{
//MUST be called by MethodA.
}
}
class two
{
internal void MethodA()
{
//Test t...
Is it possible to retrieve the MethodInfo for * operator on an Int32?
I've tried this code but without success (it returns null):
MethodInfo mi = typeof(System.Int32).GetMethod("op_Multiply");
Thanks!
...
I'm wondering what the general recommendation would be (attribute, interface, abstract class, or combination thereof) for the following implementation:
/// <summary>
/// Loads class specific information into a list for serialization. The class must extend PlugIn.
/// The filenames parameter is passed from a FileDialog.
/...