{"id":16712685,"url":"https://github.com/aaronrobinsonmsft/cominterop","last_synced_at":"2025-03-21T20:33:24.968Z","repository":{"id":112789296,"uuid":"137637175","full_name":"AaronRobinsonMSFT/COMInterop","owner":"AaronRobinsonMSFT","description":"Example on how to consume a COM server from a .NET client and a .NET server from a COM client. Examples are for both using the Registry and for RegFree.","archived":false,"fork":false,"pushed_at":"2019-10-16T19:21:02.000Z","size":57,"stargazers_count":71,"open_issues_count":2,"forks_count":18,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-18T04:52:02.808Z","etag":null,"topics":["component-object-model","regfreecom","windows"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AaronRobinsonMSFT.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-17T07:34:21.000Z","updated_at":"2025-03-15T06:27:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c6c23ae-6581-4f7a-a02a-f571e29952ee","html_url":"https://github.com/AaronRobinsonMSFT/COMInterop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaronRobinsonMSFT%2FCOMInterop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaronRobinsonMSFT%2FCOMInterop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaronRobinsonMSFT%2FCOMInterop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaronRobinsonMSFT%2FCOMInterop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AaronRobinsonMSFT","download_url":"https://codeload.github.com/AaronRobinsonMSFT/COMInterop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244866307,"owners_count":20523493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["component-object-model","regfreecom","windows"],"created_at":"2024-10-12T20:31:24.205Z","updated_at":"2025-03-21T20:33:24.950Z","avatar_url":"https://github.com/AaronRobinsonMSFT.png","language":"C#","readme":"# COM Interop\n\nThis project is an example on how to manually consume a COM server from C# or a C# server from COM client. It also contains projects for less common scenarios involving .NET and COM.\n\nRunning COM server with Net client example:\n\n1) Load `ComInterop.sln` in Visual Studio\n2) Build desired solution configuration (e.g. `Debug|x86`)\n3) Register the COM server (i.e. `ComServer.dll`) using `regsvr32.exe` from an elevated command prompt\n    * `regsvr32.exe ComServer.dll`\n4) Set the `NetClient` project as the StartUp project\n5) Press \"F5\" from within Visual Studio to debug\n\nWhen done with the project, remember to unregister the COM server with `regsvr32.exe` passing the `/u` flag (e.g. `regsvr32.exe /u ComServer.dll`).\n\nRunning Net server with COM client example:\n\n1) Load `ComInterop.sln` in Visual Studio\n2) Build desired solution configuration (e.g. `Debug|x86`)\n3) Register the Net server (i.e. `NetServer.dll`) using `regasm.exe` from an elevated command prompt\n    * `regasm.exe NetServer.dll /codebase`\n    * The `/codebase` flag adds the current path of the assembly to the registry\n4) Set the `ComClient` project as the StartUp project\n5) Press \"F5\" from within Visual Studio to debug\n\nWhen done with the project, remember to unregister the Net server with `regasm.exe` passing the `/u` flag (e.g. `regsvr32.exe /u NetServer.dll`).\n\nProjects demonstrating Registration Free (RegFree) COM are also included.\n\nRunning the RegFree COM server with Net client example:\n\n1) Load `ComInterop.sln` in Visual Studio\n2) Build desired solution configuration (e.g. `Debug|x86`)\n    * The current solution only supports the \"F5\" experience for the `AnyCPU` and `x86` platforms in RegFree COM.\n3) Set the `NetClient_RegFree` project as the StartUp project\n4) Press \"F5\" from within Visual Studio to debug\n\nRunning the RegFree Net server with COM client example:\n\n1) Load `ComInterop.sln` in Visual Studio\n2) Build desired solution configuration (e.g. `Debug|x86`)\n3) Set the `ComClient_RegFree` project as the StartUp project\n4) Press \"F5\" from within Visual Studio to debug\n\nRunning the Out-of-proc demo:\n\n1) Load the `ComInterop.sln` in Visual Studio\n2) Build desired solution configuration (e.g. `Debug|x86`)\n3) Set the `OutOfProcDemo` project as the StartUp project\n4) Press \"F5\" from within Visual Studio to debug\n\n**Note** The Out-of-proc demo launches a child process from the main process.\n\n## References\n\n[RegFree COM Walkthrough](https://msdn.microsoft.com/library/ms973913.aspx)\n\n[RegFree COM with .NET Framework](https://docs.microsoft.com/dotnet/framework/interop/configure-net-framework-based-com-components-for-reg)\n\n[Running Object Table](https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-irunningobjecttable)\n\n[Type Libraries](https://msdn.microsoft.com/library/windows/desktop/ms221060.aspx)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronrobinsonmsft%2Fcominterop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaronrobinsonmsft%2Fcominterop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronrobinsonmsft%2Fcominterop/lists"}