Solved

reference dll locations

Posted on 2004-09-09
3
324 Views
Last Modified: 2008-03-10
I have a project that uses quite a few references to other dlls. Some dll's are 3rd party components, some are from other projects in the solution.

When I deploy this application, I would like to have the .exe in a dir, and all the dll's in a subdir called 'bin'. This works fine for most of my dll's. It seems though, that any dll that comes from a project in the solution has to be in the same directory as the .exe or a subdirectory with the same name as the dll.

For example:
9/9/2004 12:40 PM: System.IO.FileNotFoundException: File or assembly name SqlDbAccess, or one of its dependencies, was not found.
File name: "SqlDbAccess"
  at SAS100.Sas100DBAccess..ctor(String sRole, String sMode)
  at SAS100.SAS100.Main()

=== Pre-bind state information ===
LOG: DisplayName = SqlDbAccess, Version=1.0.1713.11505, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = C:\Documents and Settings\me\Desktop\test\
LOG: Initial PrivatePath = NULL
Calling assembly : SAS100a, Version=1.0.1713.11561, Culture=neutral, PublicKeyToken=null.
===

LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Post-policy reference: SqlDbAccess, Version=1.0.1713.11505, Culture=neutral, PublicKeyToken=null
LOG: Attempting download of new URL file:///C:/Documents and Settings/me/Desktop/test/SqlDbAccess.DLL.
LOG: Attempting download of new URL file:///C:/Documents and Settings/me/Desktop/test/SqlDbAccess/SqlDbAccess.DLL.
LOG: Attempting download of new URL file:///C:/Documents and Settings/me/Desktop/test/SqlDbAccess.EXE.
LOG: Attempting download of new URL file:///C:/Documents and Settings/me/Desktop/test/SqlDbAccess/SqlDbAccess.EXE.


Does anyone know a way to change the dirs this looks in?

As is, I am forced to either include these dll's in the exe dir, or create 1 subdir for each project-dll.

Thanks,
jason
0
Comment
Question by:kraquen
  • 2
3 Comments
 
LVL 24

Expert Comment

by:Justin_W
ID: 12021274
Just to get the simplest workaround out of the way:
Would it work to leave the EXE in the BIN folder, and use a BAT file to launch the EXE?
0
 
LVL 24

Accepted Solution

by:
Justin_W earned 500 total points
ID: 12021317
Another option is to customize your EXE.CONFIG file using the following:

<configuration>
   <runtime>
      <assemblyBinding>
         <probing>


MSDN docs:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfProbing.asp
0
 

Author Comment

by:kraquen
ID: 12024174
i haven't tested it, but that looks like it'll do what I want.. thanks
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.Net - MemoryMappedFiles - Confirm receipt 2 24
JSON Deserialize issue 6 26
Import MySQL data into MS Access using VB.Net interface 5 29
Get month and date in a format 4 31
Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question