Solved

library file help

Posted on 2011-02-20
4
838 Views
Last Modified: 2012-05-11
Hi,

I was wondering if someone can help. I have created a class library and generated (.tlb) file within visual studio and have successfully managed add this to a project that I need to use this file (within microsoft access).
The only problem is when I make the call to the class within this it’s looking for a reference within that library. I have tried copying all the files from my release folder to the location where I have the access database application without any success.

The message is "could not load file or assembly or one of its dependencies. The system can not find the specified file". I am really not sure what i need to do.

Any help would be appreciated.

Regards,

Ross
0
Comment
Question by:ross13
[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
  • 2
4 Comments
 
LVL 75
ID: 34938485
As similar issue just came  up a couple of days ago.  Possibly info in this Q may help ...

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_26831994.html?cid=1137

mx
0
 
LVL 29

Accepted Solution

by:
nffvrxqgrcfqvvc earned 500 total points
ID: 34939312
If you don't create strong key name for your library you have to place the dll into the same directory. In your case it would have to be the same directory as Excel.exe. If you want to avoid that then give your assembly a strong name.

Project properties > Signing Tab > checkmark "sign the assembly" in the dropdown select <"New"> on the next dialog type in name of your library then un-check "Protect my key with password". click OK. Recompile.

Then you need to use RegAsm.exe with the /codebase switch. This allows mscore to locate your library any place on the system.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe "C:\mylib.dll" /tlb:mylib.tlb /codebase
PAUSE

Open in new window

0
 

Author Comment

by:ross13
ID: 34939381
Hi,

I asked another question the other day that allowed me to add this reference this via the access application by creating a .TBL file:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_26831994.html

I then tried to call a class within this and the access application gave the following message:
"could not load file or assembly or one of its dependencies. The system can not find the specified file”

The message gave the name of another .dll file that I reference in the visual studio application that I compiled as a .TBL file.

Do I need to regasm each of the other .dll files that I added into that project?

Thanks again

Ross
0
 
LVL 75
ID: 34940161
Sorry ... I didn't see you were the same person who asked the previous Q.

mx
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

705 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