473,241 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

Reflection Doubt!

Hi All, I am using Reflection for invoking an assembly.I use the
LoadFrom(string) Method, have few doubts, will appreciate all your answers.

1. Should the assembly resides in GAC or at my custom location? (Please tell
me pros/cons)
2. If multiple calls are made to the target assembly by a Multithreaded
app..it should be fine? (tips to keep in mind)

TIA
Nov 28 '05 #1
4 1466
Vai2000,

See inline:
1. Should the assembly resides in GAC or at my custom location? (Please
tell
me pros/cons)
When you use LoadFrom, you will not be loading the assembly from the
GAC. It will either be in the location specified by the path passed to
LoadFrom, or it will not. If you want to check the GAC, then you will want
to use the Load method on the Assembly class to load it (assuming that
fusion will find it in the gac).

Another thing. As of version 2.0, I believe .NET grants full trust to
everything that is placed in the GAC (being that an administrator has to
install it there). If you are creating a plug-in architecture, then I don't
know that you want to require that it is installed in the GAC.
2. If multiple calls are made to the target assembly by a Multithreaded
app..it should be fine? (tips to keep in mind)
No, it will not be. Every type in the assembly has to be coded to
handle calls from multiple threads.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com


TIA

Nov 28 '05 #2
Thanks as always

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:ul*************@TK2MSFTNGP15.phx.gbl...
Vai2000,

See inline:
1. Should the assembly resides in GAC or at my custom location? (Please
tell
me pros/cons)
When you use LoadFrom, you will not be loading the assembly from the
GAC. It will either be in the location specified by the path passed to
LoadFrom, or it will not. If you want to check the GAC, then you will

want to use the Load method on the Assembly class to load it (assuming that
fusion will find it in the gac).

Another thing. As of version 2.0, I believe .NET grants full trust to
everything that is placed in the GAC (being that an administrator has to
install it there). If you are creating a plug-in architecture, then I don't know that you want to require that it is installed in the GAC.
2. If multiple calls are made to the target assembly by a Multithreaded
app..it should be fine? (tips to keep in mind)


No, it will not be. Every type in the assembly has to be coded to
handle calls from multiple threads.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com


TIA


Nov 28 '05 #3
Let me expand on the second point. Once an assembly is loaded, all the
classes and such are handled the same as types that were loaded when your
app started. That means that if you have classes that do not maintain
state, then you should be fine (thread safe), otherwise you would need to
ensure your stuff are synchronized.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:ul*************@TK2MSFTNGP15.phx.gbl...
Vai2000,

See inline:
1. Should the assembly resides in GAC or at my custom location? (Please
tell
me pros/cons)


When you use LoadFrom, you will not be loading the assembly from the
GAC. It will either be in the location specified by the path passed to
LoadFrom, or it will not. If you want to check the GAC, then you will
want to use the Load method on the Assembly class to load it (assuming
that fusion will find it in the gac).

Another thing. As of version 2.0, I believe .NET grants full trust to
everything that is placed in the GAC (being that an administrator has to
install it there). If you are creating a plug-in architecture, then I
don't know that you want to require that it is installed in the GAC.
2. If multiple calls are made to the target assembly by a Multithreaded
app..it should be fine? (tips to keep in mind)


No, it will not be. Every type in the assembly has to be coded to
handle calls from multiple threads.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com


TIA


Nov 28 '05 #4
Hi,

Check out my article on Reflection, it might help you answer your
question.

http://www.developersdex.com/gurus/articles/739.asp

Happy Coding,

Stefan
C# GURU
www.DotNETovation.com

"You always have to look beyond the horizon and can never be complacent
-- God forbid we become complacent."

Jozef Straus

*** Sent via Developersdex http://www.developersdex.com ***
Nov 30 '05 #5

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

Similar topics

2
by: forvino | last post by:
Hi Geeks, Ihave a doubt in dotNet reflection. I m developing a tool which will returns set of public(access specifier) methods of the selected assembly. this works completely fine,...
1
by: Mudassar | last post by:
i want to get the property value using reflection. Scenerio: i have a status bar on MDI form. it has property named "Panels" and i want to get a specific panel from that panels collection using...
2
by: forvino | last post by:
Hi Geeks, Ihave a doubt in dotNet reflection. I m developing a tool which will returns set of public(access specifier) methods of the selected assembly. this works completely fine,...
2
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...
11
by: Simon Verona | last post by:
How can I write a line of code that sets an object to be an object thats contained on the parent form. Basically, I have a usercontrol, where one of the properties that I have added that can be...
0
by: forvino | last post by:
Hi Geeks, Ihave a doubt in dotNet reflection. I m developing a tool which will returns set of public(access specifier) methods of the selected assembly. this works completely fine,...
3
by: jibesh.vp | last post by:
Hi all, I have a doubt in using C# Reflection mechanism . What i need is to get method info alone from a class type. Following code gets all the Properties inside the class too and there is...
15
by: Jeff Mason | last post by:
Hi, I'm having a reflection brain fog here, perhaps someone can set me on the right track. I'd like to define a custom attribute to be used in a class hierarchy. What I want to do is to...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.