473,397 Members | 2,033 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,397 software developers and data experts.

load assembly from different folder

Hello,

let me describe my problem:
ENVIRONMENT:
..Net 2.0, MSVS 2005, c#, WinXP

SYMPTOMS:
If assembly 'AgentDesktop' IS NOT in the (loading) application folder,
Assembly.Load(AssemblyName) throws FileLoadException with Message:

"Could not load file or assembly 'AgentDesktop,
Version=1.10.2573.22044, Culture=neutral, PublicKeyToken=null' or one
of its dependencies. Access is denied.":"AgentDesktop,
Version=1.10.2573.22044, Culture=neutral, PublicKeyToken=null"

If assembly 'AgentDesktop' IS in the (loading) application folder,
Assembly.Load(AssemblyName) proceeds correctly.
ADITIONAL INFORMATION:
Q: Do I have AssemblyName.CodeBase set to the folder containing
'AgentDesktop' assembly?
A: Yes I do.

Q: Am I really sure 'AgentDesktop' assembly is in that folder?
A: Yes, I am. Moreover, othervise exception thrown would have been
FileNotFoundException and not FileLoadException according msdn
definition of FileLoadException article
http://msdn.microsoft.com/library/de...classtopic.asp
: "The exception that is thrown when a managed assembly is found but
cannot be loaded."
Q. Have I added folder containing 'AgentDesktop' assembly into the
AppDomain.CurrentDomain.SetupInformation.PrivateBi nPath calling
AppDomain.CurrentDomain.AppendPrivatePath()?
A: Yes I have.

Q: Have I used suggestions from Suzanne Cook's article 'Debugging
Assembly Loading Failures' recommended in another topic targeting this
issue:
http://blogs.gotdotnet.com/suzcook/a.../29/57120.aspx,
section 'For FileLoadException', paragraph 'For an "Access is denied"
message...'?
A:Yes I Have. None process had the file locked and without share-read
access. User under which the loading process run had full control over
the folder containing 'Agent Desktop' assembly.
I suppose this problem is somehow conected with code security issues of
..Net, however I'm not familiar with this domain. At this point I want
to ask you for help.

Many Thanks

Peter Drienovsky

Jan 25 '07 #1
2 4944
On Jan 25, 3:09 am, peter.drienov...@gmail.com wrote:
Q. Have I added folder containing 'AgentDesktop' assembly into the
AppDomain.CurrentDomain.SetupInformation.PrivateBi nPath calling
AppDomain.CurrentDomain.AppendPrivatePath()?
A: Yes I have.
The only thought I had, which you have probably already considered, is
that the folder you use with AppendPrivatePath must be a child folder
of the application folder to work IIRC. I might be mistaken about
this, however.

Chris

Jan 25 '07 #2
Hi Chris,

you are right. If assembly being loaded is in childfolder of main app
and this folder is specified in PrivateBinPath of current AppDomain,
then assembly is loaded. Helpful information as it offers some
alternatives to my original problem. Thanks.

Hovewer, I am still wondering whether one could load assemly at runtime
from arbitrary folder.
Does somebody know answer?

P.

Chris Dunaway napísal(a):
On Jan 25, 3:09 am, peter.drienov...@gmail.com wrote:
Q. Have I added folder containing 'AgentDesktop' assembly into the
AppDomain.CurrentDomain.SetupInformation.PrivateBi nPath calling
AppDomain.CurrentDomain.AppendPrivatePath()?
A: Yes I have.

The only thought I had, which you have probably already considered, is
that the folder you use with AppendPrivatePath must be a child folder
of the application folder to work IIRC. I might be mistaken about
this, however.

Chris
Jan 26 '07 #3

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

Similar topics

1
by: Zeng | last post by:
I randomly got this error: "System.IO.FileLoadException: The located assembly's manifest definition with name 'ClientToolLib' does not match the assembly reference." I noticed that in the...
5
by: Rudolf Ball | last post by:
Dear NG, i want to load a plugin (WinForm) in my Applikation. That works fine. Now I want to globalize that plugin. So I have to load the Satellite Assembly, as well. But how can I load this...
3
by: Kevin Quigley | last post by:
Hi, I have a small web application on my own machine and I am trying to copy it to our web server. I am doing this by copying all the files if the project from my machine to a folder on the web...
2
by: Eric Falsken | last post by:
Eric Falsken <eric@db4o.com> wrote on 04 Dec 2005: > craigkenisston@hotmail.com wrote on 19 Nov 2005: > >> I'm working in the migration of an asp.net application in 1.1 to 2.0. >> I'm new to...
3
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
3
by: Yusuff | last post by:
Hi, I Have created an external assembly to generate a GUID. The class is static. I am trying to access it in the Message Assignment shape in the orchestration. It seems that I can access the...
2
by: John Bailey | last post by:
I have checked around and could not find anything here that exactly matches my issue, which is odd since I have found numerous posts on this in other news groups. I have a ASP .Net 2.0 site that...
1
by: jackiechen858 | last post by:
I was updating one of my .Net 2.0 web application on a customer's server yesterday. after I replaced the new dll, I got a error when I access it : Could not load file or assembly "xxxxx" or...
0
by: Andy | last post by:
Thanks Peter, I thought I'd give an update on this problem. My application had 2 assemblies that contained classed for the Data access and business logic layer. It was on one of them that I was...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.