473,378 Members | 1,469 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,378 software developers and data experts.

URGENT :system reflexion of assenbly question?

Dear all,

I need to create an instance object of a library wit the
following way:

obj = AppDomain.CurrentDomain.CreateInstanceFromAndUnwra p
("Mylib.dll, "PluginApp.PlugIn")

This works fine as long as I place mylib.dll in the same
place as my application EXE file.

If I place that file in a particular folder like \PLUGIN,
I get an error saying it cannot find the file.

How can I make it working in order in search for the file
in \PLUGIN folder ???

thnaks for your help
regards
serge

Jul 21 '05 #1
4 1388
Look at AppDomain.CurrentDomain.AppendPrivatePath()
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"serge calderara" <se*************@maillefer.net> wrote in message
news:08****************************@phx.gbl...
Dear all,

I need to create an instance object of a library wit the
following way:

obj = AppDomain.CurrentDomain.CreateInstanceFromAndUnwra p
("Mylib.dll, "PluginApp.PlugIn")

This works fine as long as I place mylib.dll in the same
place as my application EXE file.

If I place that file in a particular folder like \PLUGIN,
I get an error saying it cannot find the file.

How can I make it working in order in search for the file
in \PLUGIN folder ???

thnaks for your help
regards
serge

Jul 21 '05 #2

Hello,

I have try to use the AppenPrivate path to current domain for assembly
reflexion as follow :

AppDomain.CurrentDomain.AppendPrivatePath(Applicat ion.StartupPath +
Global.ENVIRONMENT_PATH.PLUGINS_FILE_PATH)

obj = AppDomain.CurrentDomain.CreateInstanceFromAndUnwra p(item.FileName,
"PluginApp.PlugIn" + item.Name)

Doing this it is still able to load my assembly only if it is present in
my application folder. It does not search in the folder that I specified
in AppendPrivatePath.

What am i doing wrong ?

Thnaks for your reply
serge

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #3
AppendPrivatePath will work only if the path is relative to the app's root
folder. I don't know if you know that, sorry I didn't mention it. The actual
path has to be in relative form as well.

Or, you could use Assembly.LoadFile(). Have you tried that one?
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"calderara serge" <se*************@maillefer.net> wrote in message
news:OQ****************@TK2MSFTNGP12.phx.gbl...

Hello,

I have try to use the AppenPrivate path to current domain for assembly
reflexion as follow :

AppDomain.CurrentDomain.AppendPrivatePath(Applicat ion.StartupPath +
Global.ENVIRONMENT_PATH.PLUGINS_FILE_PATH)

obj = AppDomain.CurrentDomain.CreateInstanceFromAndUnwra p(item.FileName,
"PluginApp.PlugIn" + item.Name)

Doing this it is still able to load my assembly only if it is present in
my application folder. It does not search in the folder that I specified
in AppendPrivatePath.

What am i doing wrong ?

Thnaks for your reply
serge

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #4

Dear sir,

When I check the CurentDomain.BaseDirectory value , it has path :
E:\Runtime which is actually the path where my application is executed.

Then in AppenPrivatePath(PLUGIN_FILE_PATH) , the constant
PLUGIN_FIL_PATH = "Plugins"

So normally the search path should be : E:\Runtime\Plugins

Do I set the correct path for AppenPrivatepath ?
Does the syntax is corect ?

thnaks for your help
serge
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #5

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

Similar topics

2
by: aerge calderara | last post by:
dear all, I am using the GetTypes method of an assembly object in order to check that it implement a particular needed interface for my application. ...
2
by: Serge calderara | last post by:
Hello, I have try to use the AppenPrivate path to current domain for assembly reflexion as follow : AppDomain.CurrentDomain.AppendPrivatePath( Global.ENVIRONMENT_PATH.PLUGINS_FILE_PATH) ...
2
by: Serge calderara | last post by:
Dear all I am using the following code in my applciation AppDomain.CurrentDomain.AppendPrivatePath("\Plugins" objDomain = AppDomain.CurrentDomain.CreateInstanceFromAndUnwrap(Name + ".dll",...
16
by: | last post by:
Hi all, I have a website running on beta 2.0 on server 2003 web sp1 and I keep getting the following error:- Error In:...
2
by: Jean-Yves | last post by:
Hi people. I am trying to replace the old CallByName function of VB6 with those of .NET I have a Class with a String Property and a Method with 3 arguments which returns a DateValue. How do I...
1
by: Marc Falesse | last post by:
Hello, My application needs to serialize a class, which was generated with xsd.exe from a XSD. It was working .NET 1.1 and it is working with .NET 2.0 very well. Now I need my assembly to be a...
4
by: serge calderara | last post by:
Dear all, I need to create an instance object of a library wit the following way: obj = AppDomain.CurrentDomain.CreateInstanceFromAndUnwrap ("Mylib.dll, "PluginApp.PlugIn") This works fine...
1
by: Jose M. Nobre | last post by:
Hi, Does anyone knows if through reflexion is it possible to retrieve a parameter value? I mean, having the method: void foo( int val ) { //... inspect( ); //...
13
by: Niyazi | last post by:
Hi I have a report that I have to run it monthly in my machine. My code in VB.NET and I access AS400 to get data, anaysie it and send into pre formated Excel sheet. The data consist of 9000...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.