mskeel Posted April 21, 2004 Posted April 21, 2004 How do I use a dll that is not in the same directory as the executable. For example, how would I put a commonly used dll for many apps I make in the system32 director? There has to be some way to lookup where a dll is at runtime instead of just in the working directory of the executable. thank you for your help... Quote
wessamzeidan Posted April 21, 2004 Posted April 21, 2004 You have to place it in the GAC(Global Assembly Cache). There are some tools that registers your dll in the GAC, but I don't really remember them now Quote Proudly a Palestinian Microsoft ASP.NET MVP My Blog: wessamzeidan.net
mskeel Posted April 21, 2004 Author Posted April 21, 2004 Thanks for the info. This is definately what I'm looking for. Here's some new information (and some new problems) for anyone who's interested. http://www.superdotnet.com/directory.aspx?dirID=225 Dragging and dropping inthe the c:\windows\assembly folder gives me the following error and I was wondering if anyone knows what is wrong and how to fix it. error: DLL not strongly named Also, deployment/installation worries...anyone have any expereince with that? Thanks.. Quote
Administrators PlausiblyDamp Posted April 22, 2004 Administrators Posted April 22, 2004 The DLL will need a strong name before it can be placed in the GAC, to do this use the command lione utility sn (sn - k keyfile.snk) to generate a public / private key pair. You will then need to modify your application to use this DLL. In fact the first link on the page you suggested gives a step by step guide on what you need to do. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
mskeel Posted April 30, 2004 Author Posted April 30, 2004 in the GAC can't get it out As it turns out, getting everything into the GAC was a fairly straitforward process now that I know what to do and how it all works (pretty much) but using my library isn't as straitforward as I thought it would be. How do I use the library I just dropped into the GAC? How do I reference it in Visual Basic and the visual studio? And what about intellisensing for the library? Would I drop the XML into the GAC as well? Is that even possible. Thanks.. Quote
*Experts* Nerseus Posted April 30, 2004 *Experts* Posted April 30, 2004 When you add a reference through Visual Studio, the default dialog shows all DLLs in the GAC - it should show your Assembly there. If not, something might have gone wrong. By the way, save that strong key in a safe place. We often include the key in the project (with Build type of "None") so that it can get saved to SourceSafe (which we backup every night). Most of the intellisense will work (with any dll) - meaning, declaring "MyObject o = new ..." will show you a list of objects, including "MyObject" from the project. If you mean the descriptions that go under the method names (and for each parameter), I'm not quite sure. I haven't tried that. Some added info: I generally do NOT use the GAC for "common" DLLs. Instead, I keep them up on a network share that all developers can access. It simplifies the change process since a new DLL doesn't have to be copied to everyone's machine and updated with a new version number. Instead, the DLL is copied to the network and everyone automatically "sees" it when they rebuild their solution. -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
mskeel Posted April 30, 2004 Author Posted April 30, 2004 inline documentation and intellisense Thanks for your help. I greatly appreciate it. I have another question reguarding the GAC and intellisense features. First, adding my assembly to the project was easy as it turns out. It did not show up in the general assembly list with all the others but, if you add the dll from where the actual library is stored (not in the GAC) then it will add the proper refences from the GAC (and not make a copy of the library locally). The problem comes with my intelesense XML document. Looking at the microsoft .net framework assemblies and their associated xml documents, everything should be working but it is not. I would appreciate any help anyone could offer me...I have been unable to find any documentation on the web covering this subject. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.