Skip to content

lauxjpn/COMServerDemo.Dynamic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

COM Server Demo

This is a basic example of providing a managed COM server in .NET Core 3.0. Documentation on the inner workings of activation can be found here.

Key Features

Demonstrates how to provide a COM server in .NET Core 3.0 Preview 7 or later.

Additional comments are contained in source and project files.

Build and Run

The project will only build and run on the Windows platform. You can build and run the example either by registering the COM server or by using registration-free COM.

Registered COM

  1. Install .NET Core 3.0 Preview 7 or later.

  2. Navigate to the root directory and run dotnet.exe build.

  3. Follow the instructions for COM server registration that were emitted during the build.

  4. Navigate to COMClient/ and run dotnet.exe run.

Program should output an estimated value of π.

Note Remember to unregister the COM server when the demo is complete.

RegFree COM

  1. Install .NET Core 3.0 Preview 7 or later.

  2. Navigate to the root directory and run dotnet.exe build /p:RegFree=True.

    • If the Registered COM demo was previously run, the project should be cleaned first - dotnet.exe clean
  3. Run the generated binary directly. For example, COMClient\bin\Debug\netcoreapp3.0\COMClient.exe.

Program should output an estimated value of π.

Note The RegFree COM scenario requires a customized application manifest in the executing binary. This means that attempting to execute through dotnet.exe will not work and instead trigger a rebuild of the project.

Note Running the "Registered COM" first and then immediately following it by "RegFree COM" will not work, since the build system will not correctly rebuild all files (the simple property change is not detected as a reason for a full rebuild). To fix this, run dotnet clean between the two samples.

About

The attempt to dynamically call a .NET 5 COM object from a .NET 5 client app.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published