Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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...

Posted

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..

  • Administrators
Posted

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.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

  • 2 weeks later...
Posted

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..

  • *Experts*
Posted

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

"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
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...