Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2005-03-23
12
Medium Priority
?
1,145 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
  • 7
  • 3
10 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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 recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses
Course of the Month10 days, 9 hours left to enroll

571 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