Solved

reference dll locations

Posted on 2004-09-09
3
320 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
Comment Utility
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
Comment Utility
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
Comment Utility
i haven't tested it, but that looks like it'll do what I want.. thanks
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Normally the drop down box control found in the .Net framework tools is able to select just one data and value at a time, which is displayed on the text area.   But what if you want to have multiple values to be selected in the drop down box? As …
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now