ByteScout Screen Capturing SDK - C# - Registration Free Deployment - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout Screen Capturing SDK – C# – Registration Free Deployment

  • Home
  • /
  • Articles
  • /
  • ByteScout Screen Capturing SDK – C# – Registration Free Deployment

ByteScout Screen Capturing SDK – C# – Registration Free Deployment

Program.cs

using System;
using System.Threading;
using System.Diagnostics;
using System.Runtime.InteropServices;
using BytescoutScreenCapturingLib; // import bytescout screen capturing activex object

/*
// NOTE: if you are getting error like “invalid image” related to loading the SDK’s dll then
// try to do the following:
// 1) remove the reference to the SDK by View – Solution Explorer
// then click on References, select Bytescout… reference name and right-click it and select Remove
// 2) To re-add click on the menu: Project – Add Reference
// 3) In “Add Reference” dialog switch to “COM” tab and find Bytescout…
// 4) Select it and click “Add”
// 5) Recompile the application
// Note: if you need to run on both x64 and x86 then please make sure you have set “Embed Interop Types” to True for this reference
*/

/*
* REGISTRATION FREE SCENARIO DEPLOYMENT:

Please check README-FIRST.txt for more details!!

HOW MANIFEST FILES WERE GENERATED

1) Files from Redistributable\x86 were copied into the folder ScreenCapturingSDK\x86\
2) The regsvr42 tool ran with the following command: (The tool is acailable from http://www.codeproject.com/Articles/28682/regsvr-Generate-SxS-Manifest-Files-from-Native-D )
regsvr42 -client:SimpleCaptureCSharp.exe -dir:ScreenCapturingSDK\x86
3)the following file was generated x86.manifest
4) copy everything from this x86.manifest file from this tag:
tag (do not include this tag)
5) Main application was recompiled
6) The copied code (from 4) was pasted into the main MyApp.exe.manifest right after the tag
7) Due to the bug in regsvr42 needs to remove duplicated COM interfaces declaration:

For example the first COM interface declaration:

README-FIRST.txt

** How to setup the registration free deployment in your project **

1. Right-click your project in the solution tree, select 'Add'->'Existing Items...' menu item and add "app.manifest" file.

2. Open the project properties. On the Application tab select "app.manifest" in "Manifest" combo-box. 
   Now when you build the project the manifest will embedded into the assembly resources.

   * Alternative way *
   Rename the added "app.manifest" into "YourAssemblyName.exe.manifest".
   In the file's properties set "Copy to Output Directory" to "Copy always".
   Now the file will be copied to the output folder automatically and the manifest will be loaded from 
   the file instead of resources.

3. Right-click your project in the solution tree, select 'Add'->'Existing Items...' menu item and add 
   "ByteScoutScreenCapturing.dll", "ByteScoutScreenCapturingFilter.dll" and "ByteScoutVideoMixerFilter.dll" files.
   Set "Copy to Output Directory" property to "Copy always" for the each file.
   * You can find these files in "Redistributable" folder of the SDK installation directory.
   (Default location: "c:\Program Files\ByteScout Screen Capturing SDK\Redistributable").

4. Clean and rebuild your project.


  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next