问题
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
回答1:
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
来源:https://stackoverflow.com/questions/34772164/could-not-load-file-or-assembly-error-com-enabled-net-assembly