Learn what you need to do to run a C# application without registration of the commlpiwin32.dll
on the end users computer.
COM projects are based on interface definitions which you include into your application as references and are located in the COM dll (commlpiwin32.dll
). These references need to be resolved when running your application. One way to resolve these interfaces is by using a lookup in the registry of your Windows PC. For this to work, you have to register the COM dll on every PC you want to run your application on. Of course, this makes the process of deploying your application to other PCs more complicated. But there is another approach. By using an application manifest you can configure your application to find the interfaces in the COM dll without the need to register. The steps below show you how to do this.
Create a C# project by following the instructions in Creating a new C# project for Windows using Visual Studio 2005.
commlpiwin32.dll
on your development computer.There are two ways to include a manifest in your application, which are described below.
To use an embedded manifest you need to add an 'app.manifest' file to your Visual Studio project. Do this by selecting New->Add
Item
... in the context menu of your project and choose an Application
Manifest
File
. After the file has been added to your application project, you need to add the following lines to the section near the end of the file.
commlpiwin32.dll
that you want to deploy with your application.To use your application without registration of the dll, the end user needs at least the following files (all in the same directory):
YourApplication.exe
commlpiwin32.dll
Located in the MLPI-SDK at <install>\mlpi4COM\bin\win-vs2005sp1-x86
.commlpiwin32.dll.manifest
Located in the MLPI-SDK at <install>\mlpi4COM\bin\win-vs2005sp1-x86
.Interop.commlpiLib.dll
) Only for older Visual Studio Versions without the property Embed
Interop
Types
.The application should now be able to run without registration of the commlpiwin32.dll
. To prove this, unregister the commlpiwin32.dll
and run your application outside of Visual Studio. It should still work.
Another approach is to use an external manifest file. You can write the manifest by hand or use the dedicated tool included in the SDK, which is called 'ManifestMaker'. Execute the ManifestMaker ('<install>\mlpi4COM\bin\ManifestMaker.exe'). The following image shows the ManifestMaker's main window.
First Step:
Select the commlpiwin32.dll.manifest
file by clicking the 'Select dll-manifest' button. If the Manifest Maker is still in the default folder (<install>\mlpi4COM\bin
), you just have to change the directory to <install>\mlpi4COM\bin\win-vs2005sp1-x86
and select the commlpiwin32.dll.manifest
.
Second Step:
Select your application's 'exe' file ('YourApplication.exe') by clicking the 'Select Application' button.
Final Step:
Create a manifest for your application by clicking the 'Make Manifest' button.
After this, the main window should report 'Manifest created'. Your application's execution folder should now contain a file named 'YourApplication.exe.manifest' and the 'commlpiwin32.dll.manifest'.
To use your application without registration of the dll, the end user needs at least the following files (all in the same directory):
YourApplication.exe
YourApplication.exe.manifest
Generated by ManifestMakercommlpiwin32.dll
Located in the MLPI-SDK at <install>\mlpi4COM\bin\win-vs2005sp1-x86
.commlpiwin32.dll.manifest
Located in the MLPI-SDK at <install>\mlpi4COM\bin\win-vs2005sp1-x86
.Interop.commlpiLib.dll
) Only for older Visual Studio Versions without the property Embed
Interop
Types
.The application should now be able to run without registration of the 'commlpiwin32.dll'. To prove this, unregister the 'commlpiwin32.dll' and run your application outside of Visual Studio. It should still work.