regasm

Problem registering a dll - Access Denied

戏子无情 提交于 2019-12-05 05:07:36
When trying to run regasm in Win2008 Server: regasm "C:\Program Files\FooProg\Bar.dll" /tlb:"C:\Program Files\FooProg\Bar.tlb" I get the following error: RegAsm : error RA0000 : An error occurred while saving the exported type library: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) what does this mean The account under which you run regasm doesn't have rights to write to C:\Program Files\FooProg\ and that's why regasm fails to write the .tlb. Run regasm under an account with administrator priviledges. That error mostlikely comes up because you can't delete a

How does .NET/COM work with multiple versions registered via Regasm?

◇◆丶佛笑我妖孽 提交于 2019-12-05 04:29:55
I have a .NET DLL (that happens to be written in C++/CLI). Parts of it I want to expose via COM. I do this and register it using "regasm my.dll /codebase". So far so good. But then I change some things and the version number of the assembly changes plus I move the dll to a different folder. I register it again and look at my COM object in OLE/COM Viewer. I see something like this InprocServer32 [Codebase] = file://c://foo/bar/my.dll 7.0.0.0 [Class] = My.Blah.Class 7.0.0.0 [Assembly] = Sync, Version=7.0.0.0, Culture=neutral, PublicKeyToken=1dd19234234 7.0.0.0 [RuntimeVersion] = v2.0.50727 7.0.0

C#开发COM组件注册

旧城冷巷雨未停 提交于 2019-12-04 20:54:01
一、组件注册 运行指令: gacutil /i DLL路径\HK.NetPBDemo.dll 将这个DLL加入的全局缓存里 regasm DLL路径\HK.NetPBDemo.dll 注册这个dll 附:以上11个步骤即可完成COM组件在本机的环境下注册并提供调用。 1、 若要在其他机器使用必须把编译的“DLL”、“TLB”文件一并复制在目标机器(已安装.Net Framework环境)并放在需调用的程序根目录; 2、 在目标机器“c:\WINDOWS\Microsoft.Net\Framework\v4.0.3.319”下找到“RegAsm.exe” 3、 运行CMD打开指令窗,讲路径定位到“c:\WINDOWS\Microsoft.Net\Framework\v4.0.3.319” 运行指令:regasm.exe DLL路径\ HK.NetPBDemo.dll。 【注册成功】 二、 RegAsm安装卸载办法 安装 C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\RegAsm.exe "C:\Program Files\MyDllFolderName\MyDllName.dll" /tlb C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe "C:\Program Files

Class not registered error for Instantiation of C# object via COM from VC++

依然范特西╮ 提交于 2019-12-04 10:41:40
问题 In a VC++ project, I am trying to create an instance (via COM) of a C# class contained within a C# project. Facts Both the C# and C++ projects are compiled using .NET 4.0 The C# .dll is being registered using regasm /codebase "CSharpProjectName.dll" ", and windows command prompt reports, "Types registered successfully." In the c++ project, I attempt to create an instance of a class in the C# project, but I get an HRESULT of 0x80040154 - class not registered Here is an example of my attempt to

How to unregister my .net assembly when it's no longer in the same location?

孤街醉人 提交于 2019-12-03 16:15:46
I have a dll that's registered for com interop, so under HKLM\Software\Classes\CLSID[my guid]\InprocServer32[my version no]\Codebase it has the path of the registered dll. However, I've rearranged my folder structure so that path is no longer correct. Is there a way of unregistering that dll without putting it back, then unregistering, then removing the file again? And what if I don't have that dll any more, or only have one with a different version number? Different version numbers (generally) do not matter. As long as the newer DLL contains all the GUIDs which appear in the older version, it

Class not registered error for Instantiation of C# object via COM from VC++

会有一股神秘感。 提交于 2019-12-03 06:27:18
In a VC++ project, I am trying to create an instance (via COM) of a C# class contained within a C# project. Facts Both the C# and C++ projects are compiled using .NET 4.0 The C# .dll is being registered using regasm /codebase "CSharpProjectName.dll" ", and windows command prompt reports, "Types registered successfully." In the c++ project, I attempt to create an instance of a class in the C# project, but I get an HRESULT of 0x80040154 - class not registered Here is an example of my attempt to create an instance of the .NET object from the C# .dll. The concrete class I am trying to instantiate

RegAsm Unregister Issue

大城市里の小女人 提交于 2019-12-02 09:07:54
问题 Below, the method i' ve created is working for registering. But i get: "regasm : warning ra0000 : no types were unregistered" for unregistering. private static void ExecuteRegAsm(string comObjectPath, string typeLibraryName, string regAsmPathToExecute, string regAsmParameter = null) { var startInfo = new ProcessStartInfo { CreateNoWindow = false, UseShellExecute = false, FileName = regAsmPathToExecute, WindowStyle = ProcessWindowStyle.Hidden }; switch (regAsmParameter) { case null: startInfo

RegAsm Unregister Issue

别说谁变了你拦得住时间么 提交于 2019-12-02 04:21:28
Below, the method i' ve created is working for registering. But i get: "regasm : warning ra0000 : no types were unregistered" for unregistering. private static void ExecuteRegAsm(string comObjectPath, string typeLibraryName, string regAsmPathToExecute, string regAsmParameter = null) { var startInfo = new ProcessStartInfo { CreateNoWindow = false, UseShellExecute = false, FileName = regAsmPathToExecute, WindowStyle = ProcessWindowStyle.Hidden }; switch (regAsmParameter) { case null: startInfo.Arguments = comObjectPath + " /tlb:" + typeLibraryName + " /Codebase"; break; case "/u": case "-u":

Why exactly does regasm warn me about signing with a strong name?

♀尐吖头ヾ 提交于 2019-12-01 17:46:01
If I want to make a .NET assembly usable as a COM server I have to add a set of attributes and then use regasm to register it as a COM server. If the assembly is not signed with a strong name regasm when run with /codebase key shows a RA0000 warning saying that the assembly could interfere with other assemblies on the same computer and I should sign it with a strong name, but registration succeeds and it even works just fine. AFAIK strong names are intended to prevent so-called DLL hell. But COM was also meant to prevent DLL hell. If I change any interface exposed to COM I must either change

Why does Regasm put ProgId into HKEY_CURRENT_USER?

元气小坏坏 提交于 2019-12-01 06:47:57
I have two Virtual Machines that I wish to (Wix) install my software onto. One is Windows XP SP2 and another is Windows XP SP1. Neither of them use domains, and both of them have the local user Administrator with admin privileges. Running RegAsm.exe to register MyApp.dll on the machine with SP3 puts my ProgId in the folders: HKEY_CLASSES_ROOT\MyAppProgId HKEY_LOCAL_MACHINE\Software\Classes\MyAppProgId whereas running it on the SP2 machine puts it in the folders: HKEY_CLASSES_ROOT\MyAppProgId HKEY_CURRENT_USER\Software\Classes\MyAppProgId I found this while trying to load MyApp.dll from a