473,587 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

about the probing tag and assembly location

Alright, I think I have a better perception of assemblies and environment
variables now. The question I had initially posted was pertaining setting of
environment variables using the VSI installer. This was presumed essential
for specifying the paths to certain dlls. Subsequently, the idea was dropped,
and the appication configuration file approach was adopted. However, the
application is not able to resolve the assembly location, and raises a
System.DllNotFo undError exception. I would appreciate if any one of you can
read the following, and give some constructive feedback:

Brief background:
--------------------
The application uses dlls made in c++/c, which have been wrapped for using
in C#. Initially, we had set the environment variables manually on our
machines to point to the location of these dlls. As expected, that worked
without any problem, though in retrospect, this approach could perhaps have
been avoided.

app.config file modified:
----------------------------
Configuration files seem to be a better way for locating assemblies. Since
the dlls in question were not strongly typed, I modified the <probing> tag of
the app.config file instead of the <codeBase> tag. I assumed the application
base folder to be the one where my application executable is located, and
subsequently had my installer place all the folders containing the different
dlls into this directory, so that they may be accessed as subfolders by the
probing tag.

All seemed well so far. One of those folders had the dll in question.
Installing and running the application however, made the application raise an
exception when this dlls was needed, a System.DllNotFo undError.

Possible problem?:
----------------------

Thanks to a software one of my colleagues gave me, I was able to monitor the
files that were being accessed by all processes on my computer. On studying
the log, it appeared that my application was searching in all paths, except
for the one specified in the probing tag's privatePath attribute. It is
correctly defined; I have checked up the syntax and examples, so that's not
the reason for the problem. It seems like the application is not able to pick
up this information from the application configuration file, so it does not
look into the concerned subfolder and therefore, raises the given exception.

As a test, I physically copied this dll from the subfolder into the
application folder, and yes, this time the exception was not raised.

I'm not sure where the problem is now. Could it be the config file? Or since
this wrapped dll needs to be invoked by another one, somehow that's not
working (though it does if placed in the application folder).

Any help would be great

Thanks!
Jan 18 '06 #1
2 2958
It would help if you could post parts of the config file that are
relevant to your problem. Kinda hard to tell what the problem could be
with your config file without having a look at it ;)

- NuTcAsE

Jan 18 '06 #2
Sure I could do that, though I think it might not help.... Here's the block I
used in the config file:

<runtime>
<assemblyBindin g xmlns="urn:sche mas-microsoft-com:asm.v1">
<probing privatePath="Dl lFolder" />
</runtime>

You may assume this to be a subfolder in the application base folder (where
the applciation executable is).

Now I suspect the problem is not because of the config file. It seems to me
that the config file is only read when the application is loaded. If later
the application needs to invoke a dll, the app.config file will not be read
again, and therefore, the application will have no way of accessing the dll.

And since all the dlls I'm using are weakly named, I don't think I can use
any other feature of the config files, either application based or machine
based.

As things stand currently, it seems like I have the following two options:

a) To have the user set the environment variables (Path) or do that from my
installer program, an approach I'm not inclined to taking and I'm sure none
of you will encourage it.

b) The second solution would be to dump all the required dlls in the
application folder: This solution would be less elegant and not as memory
efficient, but atleast it would work...

Do you have any suggestions that might help?

Thanks
"NuTcAsE" wrote:
It would help if you could post parts of the config file that are
relevant to your problem. Kinda hard to tell what the problem could be
with your config file without having a look at it ;)

- NuTcAsE

Jan 18 '06 #3

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

Similar topics

1
3928
by: Robert Scheer | last post by:
Hi. The docs say the <probing> element needs to refer to subdirectories of the application main directory. My windows application needs to locate an assembly in a directory above the application directory. Is it possible? Can I use the <probing> element to locate an assembly anywhere on the machine? Thanks, Robert Scheer
5
1499
by: ptass | last post by:
If i create a simple windows form .exe then launch it via a href, ( simple one touch deployment ), why does the .net framework/iis search in multiple places and for multiple files derived from the actual .exe name. ( most of which don't exist ) eg; 2005-03-01 04:47:35 10.2.5.229 GET /Components/Softix.Platform.Application.Startup.exe - 80...
0
1836
by: mqsash | last post by:
Hi, I have a simple C# assembly ( .dll ) which I deployed through an HTML.The complete assembly is as simple as this using System; using System.Windows.Forms; namespace testAssemblyNS { public class Class1
8
5079
by: A. Elamiri | last post by:
Hello, I created a small app which acts as a services manager. I basically drop a DLL in a Services folder and set the frequency through the application for how often do I want the code in the assembly to run (scheduler). I created a seperate AppDomain here is the code: .... AppDomainSetup ads = new AppDomainSetup(); string path =
2
6793
by: Jiho Han | last post by:
This has been asked many times before but it seems there haven't been clear answers. I have an application root at http://localhost and subdirectories http://localhost/app1
0
1034
by: Tyrven | last post by:
I have a localized website that has been in production for sometime. Recently, localizations for one particularly locale (zh-TW) stopped displaying on the test application; the same locale works fine on the staging site (which is a different IIS application on the same server). Given that the code and application settings are the same...
2
2386
by: Joel D Kraft | last post by:
I'm using controls in my ASP.NET application from a couple of vendors. Between the vendors and thier versioning, I've set up subfolders under my bin directory: bin bin\Infragistics\v5.2 bin\RadControls\v5.3 Under 2.0b2, I had the following setup in my web.config: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
1
1683
by: Shiraz | last post by:
Hi It seems like none of the old posts get any follow up after a few messages, whether or not something constructive comes out of them, so I'm left with no choice but to repost an earlier question I asked. Below I've copy-pasted the log of the last post. It's an interesting problem, and it might well be worth reading if you are willing to...
1
5434
by: CorporateCoder | last post by:
Is there a way to group dll files by putting them in a subdirectory in the bin directory for ASP.net 2.0 Web Site projects and have the CLR find them? I tried using <probing> and adding the following to the appropriate location (<configuration>) in the web.config file to indicate I wanted it to look in the bin\subbin directory, but to no...
0
7918
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8206
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8220
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...
0
6621
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...
1
5713
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...
0
5392
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...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.