473,837 Members | 1,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reflection

Hola a todos!

Estoy intentando ejecutar un método usando Reflection.
El código es el siguiente:

public static void SoapHandler(Exc eption Error) {
try
{

Type assemblyType;
object genericInstance ;
assemblyType = BuscarClaseEnAs sembly("SoapExc eptionSample", "DefaultMasterP age");
object[] args = new object[] { Error.Message, Error.Message.T oString() };
//Creamos la instancia
genericInstance = Activator.Creat eInstance(assem blyType);
assemblyType.In vokeMember("Men saje",
System.Reflecti on.BindingFlags .Instance | System.Reflecti on.BindingFlags .Public |
System.Reflecti on.BindingFlags .SetProperty,
null,
genericInstance ,
args); //<---- Error: No se puede encontrar el método 'SoapExceptionS ample.DefaultMa sterPage.Mensaj e

assemblyType.In vokeMember("Det alles",
System.Reflecti on.BindingFlags .Instance | System.Reflecti on.BindingFlags .Public |
System.Reflecti on.BindingFlags .SetProperty,
null,
genericInstance ,
args); //<---- Error: No se puede encontrar el método 'SoapExceptionS ample.DefaultMa sterPage.Detall es

assemblyType.In vokeMember("Mos traError",
System.Reflecti on.BindingFlags .Instance | System.Reflecti on.BindingFlags .Public |
System.Reflecti on.BindingFlags .InvokeMethod,
null,
genericInstance ,
args); //<---- Error: No se puede encontrar el método 'SoapExceptionS ample.DefaultMa sterPage.Mostra rError

}
catch (Exception ex) { }

}

Sin embargo, obtengo un error al intentar hacer un InvokeMember en la primera instrucción

No se puede encontrar el método 'SoapExceptionS ample.DefaultMa sterPage.Mensaj e
Estoy utilizando ASP.NET 2.0, la idea es ejecutar un método que se encuentra en una MasterPage desde otro ensamblado.
Mensajey Detallescorresp onden a propiedades que se encuentran en la masterpage y MostraError() corresponde al método que deseo ejecutar.

¿Alguna idea?

Saludos cordiales,
Gustavo

Sep 24 '08 #1
0 1706

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1391
by: A. Wiebenga | last post by:
Hi all! I am a student at the Hogeschool van Arnhem en Nijmegen in Holland. I am currently involved in a research project regarding Reflection. Purpose of the research project is to document what Reflection is (I can answer this question myself), what kind of Reflection Techniques there are (.NET Reflection, Python Reflection etc. I can answer this one myself too). The main question I need to answer is related to the implementation of...
10
7378
by: Sunny | last post by:
Hi, I have an old problem which I couldn't solve so far. Now I have found a post in that group that gave me an idea, but I can not fully understand it. The problem is: I'm trying to use a Windows.Forms.UserControl in a COM environment, i.e. I want to host that control in a COM host. So far, so good, I can host it, but I can not reach the parent COM object from the control (Parent property is null :( ). I have stopped the control in the...
2
864
by: Jason Coyne Gaijin42 | last post by:
I have seen several people looking for a way to access the Columns collection when using the AutoGenerate = true option. Some people have gotten so far as to find the private autoGenColumnsArray that has the information, but we as developers have no way to access this information. I have come up with a solution for the problem, (as I am sure many others have) using reflection. Here is some sample code that will print out the auto...
2
2019
by: Mark | last post by:
Am I out of my mind if I use Reflection everytime someone logs into our site to get and track the current Major/Minor/Build/Revision version that the person is viewing our site through? This information would then be logged to a database along with some other information about the user. Thanks in advance. Mark
0
1554
by: Shawn Hogan | last post by:
Hi everyone, I've been trying to execute a control's private event code via reflection from another class with the goal of potentially doing some unit testing. The examples below are trying to execute button2's click event. This works great when i know the name of the method that i want to invoke. I do so by doing this: Dim AssemblyPointer As Reflection.Assembly
9
3850
by: Kuberan Naganathan | last post by:
Hello all Does anyone know of a good way to use reflection in c++? I don't mean simply using rtti or dynamic casting. I'm talking about java/c# style reflection where an actual instance of an object can be constructed through reflection and method calls can be made via the reflection apis.
17
2315
by: raylopez99 | last post by:
What good is C# Reflection, other than to find out what types are in an assembly? And to dynamically invoke methods in an assembly (.dll or .exe)? Also, bonus question, can you use Reflection to build a compiler? One that will construct a user defined class "on the fly" (literally, the user defines a class, instantiates it, and runs it from the console mode, all the while prompted by the program)? I guess so, but my final question...
0
895
by: Gustavo Arriola | last post by:
Hello everybody! I'm trying to execute a method using Reflection. The code is as follows: public static void SoapHandler(Exception Error) { try { Type assemblyType;
0
10578
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10631
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10276
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9409
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7813
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7006
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5851
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4477
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3126
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.