"Could not load file or assembly" Error Com-Enabled .Net Assembly
Asked Answered
K

1

0

Currently, I am stuck with a classic asp project, that needs to call a .Net Assembly. It was working, until the customer had to wipe their server. I was able to reregister the .Net Assembly, but I get this error during runtime:

MyDll error '80070002'

Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.

Here is the asp code, not sure if it will help.

set Inst = Server.CreateObject("MyDll.AddressValidator")

If Inst.ProcessAddress(Adr1,City, State, Zip) Then
   'code
End If
Knit answered 13/1, 2016 at 16:39 Comment(3)
Is any of the information here useful? - msdn.microsoft.com/en-us/library/ms404285(v=vs.110).aspxQuickwitted
John, it did help. I hadn't thought I would need gacutil to load the Newtonsoft json dll, but it worked!!!Knit
If you've solved the problem you're allowed to answer your own question, you worked it out, and it's useful for future reference.Quickwitted
K
0

The resolution was to register the Newtonsoft dll in the GAC, using the gacutil executable. I thought it was enough to register my dll with regasm.exe and have the Newtonsoft dll in the same directory. Thanks to John prompting me with a link. I had read it before, but decided to stop, breath, and follow all the steps.

Wade

Knit answered 15/1, 2016 at 13:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.