How do I package Chant libraries in a ClickOnce deployment?
Last reviewed: 6/1/2012
HOW Article ID: H061202
The information in this article applies to:
- GrammarKit 4
- LexiconKit 4
- ProfileKit 4
- SpeechKit 7
- VoiceMarkupKit 4
Summary
ClickOnce deployments offer a way to deliver .NET applications with highly automated installation and updating processes for end-users.
To create a ClickOnce deployment, Publish applications using the Visual Studio Project Properties Publish tab.
There is a Publish Wizard to generate the necessary publishing settings and create required directories.
If an application includes assemblies that rely on interop files, such as the ones that use COM based SAPI and other speech APIs, then ensure the Isolated property is set to True for these references.
This works for 32-bit applications. However, this does not work for 64-bit applications. There are different steps required to support interop files in 64-bit application ClickOnce deployments.
More Information
For 32-bit applications, the following steps ensure interop files work with ClickOnce deployments:
Expand the References folder.
Highlight the interop file.
Select the Isolated property and set value to True.
For 64-bit applications, setting the Isolated property to true for interop files will not work with the 32-bit version of MSBuild. There are two alternative methods for deploying 64-bit applications:
Run 64-bit MSBuild to build the application or
Run 32-bit MSBuild to build the application and create a manifest file for interop files and embed it as a post build step.
The following steps summarize the process of invoking the 64-bit MSBuild to build 64-bit applications:
Expand the References folder.
Highlight the interop file.
Select the Isolated property and set value to True.
Open a command prompt with Administrator privilege.
Navigate to the folder where the 64-bit MSBUILD is installed. The folder path should be something like “\Windows\Microsoft.NET\Framework64\v4.0.30319”.
Type MSBUILD.exe “path and the name of the CSPROJ file”.
The command line would look something like:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>msbuild.exe "C:\Users\Chant Development\Documents\ Chant SpeechKit 7\Win64\NET WinForms\VS 2010\CSharp\Synthesis\Synthesis.csproj"
The following steps summarize the process for manually creating and embedding a manifest file with 64-bit applications when using the default 32-bit MSBuild:
Expand the References folder.
Highlight the interop file.
Select the Isolated property and set value to False.
Create a manifest file that lists the COM interfaces in the interop file. The file name should be appexename.exe.manifest.
Embed the manifest file using mt.exe as a post build step.
A sample manifest file for 64-bit application using SpeechKit is as follows:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="Synthesis.exe" version="4.0.0.0" processorArchitecture="AMD64" type="win32" />
<file name="NSpeechKitX64.dll">
<typelib tlbid="{2C19A33A-BC19-4DCF-AAC5-1A3B112CF9AC}" version="7.0" helpdir="" resourceid="0" flags="HASDISKIMAGE" />
<comClass clsid="{1420BE50-2F1E-4760-AE58-76EFE0EDC16A}" threadingModel="Both" tlbid="{2C19A33A-BC19-4DCF-AAC5-1A3B112CF9AC}" progid="NSpeechKitX64.NChantAudio.7" />
<comClass clsid="{1C7722C3-5834-4082-99FF-CF74CE0FE62C}" threadingModel="Both" tlbid="{2C19A33A-BC19-4DCF-AAC5-1A3B112CF9AC}" progid="NSpeechKitX64.NChantSR.7" />
<comClass clsid="{1E70F01B-85D0-4B46-B288-0BD33A8E8B43}" threadingModel="Both" tlbid="{2C19A33A-BC19-4DCF-AAC5-1A3B112CF9AC}" progid="NSpeechKitX64.NChantTTS.7" />
</file>
</assembly>
A sample post-build event command line (Build Events tab under Visual Studio Project Properties) to merge the manifest is as follows:
"C:\Program Files\Microsoft.NET\SDK\V2.0 64bit\bin\mt.exe" -manifest Synthesis.exe.manifest -outputresource:Synthesis.exe;#1
Since the Chant library interop files are embedded in the .NET assembly files, they do not need to be distributed with the application.
For more information about ClickOnce deployments, review the Microsoft ClickOnce documentation.
For additional help with ClickOnce application deployments with Chant libraries, contact Chant Support via or web.