Solved

library file help

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
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 functions 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 Ac…
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.

831 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