RegAsm : error RA0000 : Count not load file or assembly '...' or one of its dependencies. Operation is not supported.
It turns out this is a security thing, due to not trusting my network drive (where the DLL is kept).
The fix was to go to c:\windows\Microsoft.NET\Framework\v4.0.30319\ and open regasm.exe.config in a text editor. Mine now looks like this (the lines I added are shown in red):
<requiredruntime imageversion="v4.0.30319" safemode="true" version="v4.0.30319">
<supportedruntime sku="client" version="v4.0">
<loadfromremotesources enabled="true"> </loadfromremotesources></runtime>
I didn't have to do this with the .NET2 version of regasm.
By the way, if you get an error complaining about "CoCreateInstance failed with error 0x80040154", that (in my case) was due to having previously registered this DLL as a .NET2 assembly with .NET2 version of regasm. Recompiling the DLL for any of .NET3 or .NET3.5 was fine, but targetting .NET4 gave that error. Hence the need to register it again using v4 of regasm.