How to register a .NET assembly as COM?

Are you sure you have the right RegAsm in your path since you’re calling it by exe name only without specifying the full path? You must call the right version of RegAsm for it to work, i.e 32 or 64-bit version of .NET 4. Try specifying the full path: c:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe /codebase F:\Workflow\WorkflowHandler\bin\debug\WorkflowHandler.dll or c:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe /codebase … Read more

Exception from HRESULT: 0x80070057 (E_INVALIDARG)

Clear out the temporary framework files for your project in: For Windows 7, the path is: C:\Users\[username]\AppData\Local\Temp\Temporary ASP.NET Files\ For 64 bit systems with ‘Framework’ in the path the full path is: C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\ http://www.solutioncottage.com/ShowSolution.aspx?solID=59

How to get the assembly (System.Reflection.Assembly) for a given type in .Net?

Assembly.GetAssembly assumes you have an instance of the type, and Type.GetType assumes you have the fully qualified type name which includes assembly name. If you only have the base type name, you need to do something more like this: public static String GetAssemblyNameContainingType(String typeName) { foreach (Assembly currentassembly in AppDomain.CurrentDomain.GetAssemblies()) { Type t = currentassembly.GetType(typeName, … Read more

Caching reflection data

ConcurrentDictionary<WeakReference, CachedData> is incorrect in this case. Suppose we are trying to cache info for type T, so WeakReference.Target==typeof(T). CachedData most likely will contain reference for typeof(T) also. As ConcurrentDictionary<TKey, TValue> stores items in the internal collection of Node<TKey, TValue> you will have chain of strong references: ConcurrentDictionary instance -> Node instance -> Value property … Read more

System.IO.FileNotFoundException: Could not load file or assembly ‘X’ or one of its dependencies when deploying the application

… Could not load file or assembly ‘X’ or one of its dependencies … Most likely it fails to load another dependency. you could try to check the dependencies with a dependency walker. I.e: https://www.dependencywalker.com/ Also check your build configuration (x86 / 64) Edit: I also had this problem once when I was copying dlls … Read more