Can't Load Assembly (.DLL) that's visible

2019-07-12 02:53发布

问题:

As shown in the screenshot, VS 2010 is failing to load my OAuth reference despite the fact that it is RIGHT THERE in my References folder. What am I doing wrong? I have already restarted VS 2010.

Thanks for your help.

回答1:

An assembly (the DLL) does not necessarily need to use the same names for namespaces as the DLL name. This means that your assembly (EvernoteOAuthNet.dll) may use a completely different namespace structure, ie: Evernote.OAuth. You can double-click on the assembly in References to view it in the Object Browser, and inspect what types it contains, including their namespaces. This may help you pick the right namespace for your using .



回答2:

The problem was VS 2010 was deleting the assembly every time I would try to build. I found the solution:

You need to change your target framework from ".NET Framework 4 Client Profile" to ".NET Framework 4"

Ref. http://social.msdn.microsoft.com/Forums/en-US/vststest/thread/1537c41b-52b9-4e47-91b2-2e38b8fdfbfa/