Solved

library file help

Posted on 2011-02-20
4
796 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now