?
Solved

.NET Question -- .dll's not being put in bin directory of dependent project

Posted on 2005-03-23
12
Medium Priority
?
1,142 Views
Last Modified: 2011-09-20
This might be a tough one, but 500 points to anyone who can get me a solution.  

I've got a Solution in Visual Studio .NET 2003.   I've got 20 projects in that solution.     The last one in the build order is dependent upon about 6 other projects, so when it builds, it puts the .dll's from those other 6 in its bin directory.  

Well, the last one to build before it isn't copying the .dll into its directory when it builds.    No warnings are given, no erros, everything looks great until I try to debug or browse to the pages utilizing the code from that project.    

Anyone got any ideas?  

Thanks in advance for the help.
0
Comment
Question by:keith_dude
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
12 Comments
 
LVL 35

Expert Comment

by:YZlat
ID: 13613394
are you sure it cimpiled without error?
0
 
LVL 35

Expert Comment

by:YZlat
ID: 13613411
if the project compiled correctly, building your project will put the dll in the bin directory
0
 
LVL 1

Author Comment

by:keith_dude
ID: 13613991
Yes.   It built-- all projects in the solution report no errors, no warnings.    

And no, the .dll was not put in the bin directory of the project that has it as a dependency.  
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Expert Comment

by:YZlat
ID: 13621859
what kind of project did you create? web project?

try searching for your dll, perhaps it was placed elsewhere
0
 
LVL 1

Author Comment

by:keith_dude
ID: 13621968
It's a web project.    The dll was placed in the bin directory of its own, but when another project in the same solution has it as a dependency, the dll gets copied to that one's bin directory.    For whatever reason, it wasn't.     That's what I'm looking for.  
0
 
LVL 35

Expert Comment

by:YZlat
ID: 13624376
so you want the dll copied to another project's directory?

Since multiple projects will be using the same dll, why don't you make it a shared assembly. You can do so by running sn.exe and Gacutil.exe tools
0
 
LVL 1

Author Comment

by:keith_dude
ID: 13625906
I'm sorry.    What is sn.exe and GACutil.exe?  Are they a part of Visual Studio .net?  

How do I do that?    From the VS.NET command prompt?  
0
 
LVL 35

Expert Comment

by:YZlat
ID: 13876559
yeah, you can run both of them from a command prompt. First run sn.exe to create a string name, then run Gacutil.exe to place your assempbly into GAC
0
 
LVL 35

Expert Comment

by:YZlat
ID: 13876574
Generate a Strong Name for the Assembly
You must generate a strong name for the assembly that this project will generate. Without a strong name, you cannot use COM+ services to register this assembly.

To generate this cryptographic key pair, use the Strong Name (Sn.exe) tool, which is located in the Bin folder where the .NET Framework Software Development Kit (SDK) is installed. Use the following command-line syntax to run the Sn.exe tool:
sn -k drive letter\DirectoryToPlaceKey\KeyName.snk
1. To open a Visual Studio .NET command prompt, click Start, point to Programs, point to Microsoft Visual Studio .NET, point to Visual Studio .NET Tools, and then click Visual Studio .NET Command Prompt.
2. At the command prompt, type the following command:
sn -k drive letter:\Project Root Folder\poolkey.snk
3. Press the ENTER key to generate the key pair. Notice that the following message appears in the command window:
Key pair written to...  
4. To associate this key with the project's assembly, double-click AssemblyInfo.vb in Solution Explorer. By default, Visual Studio .NET includes assembly attributes in this file when you create a project. Add the following code to this list of assembly attributes:<Assembly: AssemblyKeyFile("..\..\poolkey.snk")>
                              
 
0
 
LVL 35

Accepted Solution

by:
YZlat earned 2000 total points
ID: 13876600
Installing Richer Components controls in the Global Assembly Cache

 
First, open a command prompt and browse to the appropriate .dll file. Type the following command (this example is for RichTextBox so substitute this for the appropriate control in your case).

 

gacutil.exe -i richtextbox.dll

 

Or if gacutil.exe is not available globally then browse to it’s installation folder at –

C:\program files\Microsoft VisualStudio .NET\FrameworkSDK\bin\gacutil.exe

or C:\program files\Microsoft Visual Studio .NET 2003\SDK\v1.1\bin\gacutil.exe if you're running VS 2003 so CD (prompt change directory command) to this Directory first then run gacutil.exe -i C:\Program Files\RichTextBox v2.0\Bin\richtextbox.dll

 

You can also run it directly from the Visual Studio.Net Command Prompt which is under Start/Programs/Visual Studio.Net/Visual Studio.Net Tools.

 

Note: you may also open an Explorer window at C:\winnt\assembly and another Explorer window at the .dll location and simply drap and drop the .dll into the Assemby folder which will add it to the GAC. This does not require gacutil.exe to be run.

 

Next, in web.config (for an application-wide setting) or machine.config (for a machine-wide configuration) add this:

 

<compilation defaultLanguage="c#" debug="false">    

      <assemblies>        

             <add assembly="RichTextBox, Version=2.0.0.0, Culture=neutral,  

               PublicKeyToken=XXXX" />      

      </assemblies>

</compilation>

 

You can get the public key token from the GAC Viewer, which you can access by browsing to C:\WINNT\assembly or C:\Windows\assembly if you’re running Windows XP.

 
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

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