“Could not load file or assembly” Error Com-Enabled .Net Assembly

情到浓时终转凉″ 提交于 2021-01-29 17:41:58

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!