This example uses the GenerateApplicationManifest task to generate a ClickOnce application manifest and the GenerateDeploymentManifest task to generate a deployment manifest for an application with a single assembly. It then uses the SignFile task to sign the manifests.
This illustrates the simplest possible manifest generation scenario where ClickOnce manifests are generated for a single program. A default name and identity are inferred from the assembly for the manifest.
Note: |
|---|
In the example below, all application binaries are pre-built in order to focus on manifest generation aspects. This example produces a fully working
ClickOnce deployment.
|
Note: |
|---|
For more information on the
Thumbprint property used in the SignFile task in this example, see SignFile Task.
|
<Project DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<EntryPoint Include="SimpleWinApp.exe" />
</ItemGroup>
<PropertyGroup>
<Thumbprint>
<!-- Insert generated thumbprint here -->
</Thumbprint>
</PropertyGroup>
<Target Name="Build">
<GenerateApplicationManifest
EntryPoint="@(EntryPoint)">
<Output
ItemName="ApplicationManifest"
TaskParameter="OutputManifest"/>
</GenerateApplicationManifest>
<GenerateDeploymentManifest
EntryPoint="@(ApplicationManifest)">
<Output
ItemName="DeployManifest"
TaskParameter="OutputManifest"/>
</GenerateDeploymentManifest>
<SignFile
CertificateThumbprint="$(Thumbprint)"
SigningTarget="@(ApplicationManifest)"/>
<SignFile
CertificateThumbprint="$(Thumbprint)"
SigningTarget="@(DeployManifest)"/>
</Target>
</Project>
This example uses the GenerateApplicationManifest and GenerateDeploymentManifest tasks to generate ClickOnce application and deployment manifests for an application with a single assembly, specifying name and identity of manifests.
This example is similar to previous example except the name and identity of the manifests are explicitly specified. Also, this example is configured as an online application instead of an installed application.
Note: |
|---|
In the example below, all application binaries are pre-built in order to focus on manifest generation aspects. This example produces a fully working
ClickOnce deployment.
|
Note: |
|---|
For more information on the
Thumbprint property used in the SignFile task in this example, see SignFile Task.
|
<Project DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<EntryPoint Include="SimpleWinApp.exe" />
</ItemGroup>
<PropertyGroup>
<Thumbprint>
<!-- Insert generated thumbprint here -->
</Thumbprint>
</PropertyGroup>
<Target Name="Build">
<GenerateApplicationManifest
AssemblyName="SimpleWinApp.exe"
AssemblyVersion="1.0.0.0"
EntryPoint="@(EntryPoint)"
OutputManifest="SimpleWinApp.exe.manifest">
<Output
ItemName="ApplicationManifest"
TaskParameter="OutputManifest"/>
</GenerateApplicationManifest>
<GenerateDeploymentManifest
AssemblyName="SimpleWinApp.application"
AssemblyVersion="1.0.0.0"
EntryPoint="@(ApplicationManifest)"
Install="false"
OutputManifest="SimpleWinApp.application">
<Output
ItemName="DeployManifest"
TaskParameter="OutputManifest"/>
</GenerateDeploymentManifest>
<SignFile
CertificateThumbprint="$(Thumbprint)"
SigningTarget="@(ApplicationManifest)"/>
<SignFile
CertificateThumbprint="$(Thumbprint)"
SigningTarget="@(DeployManifest)"/>
</Target>
</Project>
This example uses the GenerateApplicationManifest and GenerateDeploymentManifest tasks to generate ClickOnce application and deployment manifests for an application with multiple files and assemblies.
Note: |
|---|
In the example below, all application binaries are pre-built in order to focus on manifest generation aspects. This example produces a fully working
ClickOnce deployment.
|
Note: |
|---|
For more information on the
Thumbprint property used in the SignFile task in this example, see SignFile Task.
|
<Project DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<EntryPoint Include="SimpleWinApp.exe" />
</ItemGroup>
<PropertyGroup>
<Thumbprint>
<!-- Insert generated thumbprint here -->
</Thumbprint>
<DeployUrl>
<!-- Insert the deployment URL here -->
</DeployUrl>
<SupportUrl>
<!-- Insert the support URL here -->
</SupportUrl>
</PropertyGroup>
<Target Name="Build">
<ItemGroup>
<EntryPoint Include="SimpleWinApp.exe"/>
<Dependency Include="ClassLibrary1.dll">
<AssemblyType>Managed</AssemblyType>
<DependencyType>Install</DependencyType>
</Dependency>
<Dependency Include="ClassLibrary2.dll">
<AssemblyType>Managed</AssemblyType>
<DependencyType>Install</DependencyType>
<Group>Secondary</Group>
</Dependency>
<Dependency Include="MyAddIn1.dll">
<AssemblyType>Managed</AssemblyType>
<DependencyType>Install</DependencyType>
<TargetPath>Addins\MyAddIn1.dll</TargetPath>
</Dependency>
<Dependency Include="ClassLibrary3.dll">
<AssemblyType>Managed</AssemblyType>
<DependencyType>Prerequisite</DependencyType>
</Dependency>
<File Include="Text1.txt">
<TargetPath>Text\Text1.txt</TargetPath>
<Group>Text</Group>
</File>
<File Include="DataFile1.xml ">
<TargetPath>Data\DataFile1.xml</TargetPath>
<IsDataFile>true</IsDataFile>
</File>
<IconFile Include="Heart.ico"/>
<ConfigFile Include="app.config">
<TargetPath>SimpleWinApp.exe.config</TargetPath>
</ConfigFile>
<BaseManifest Include="app.manifest"/>
</ItemGroup>
<Target Name="Build">
<GenerateApplicationManifest
AssemblyName="SimpleWinApp.exe"
AssemblyVersion="1.0.0.0"
ConfigFile="@(ConfigFile)"
Dependencies="@(Dependency)"
Description="TestApp"
EntryPoint="@(EntryPoint)"
Files="@(File)"
IconFile="@(IconFile)"
InputManifest="@(BaseManifest)"
OutputManifest="SimpleWinApp.exe.manifest">
<Output
ItemName="ApplicationManifest"
TaskParameter="OutputManifest"/>
</GenerateApplicationManifest>
<GenerateDeploymentManifest
AssemblyName="SimpleWinApp.application"
AssemblyVersion="1.0.0.0"
DeploymentUrl="$(DeployToUrl)"
Description="TestDeploy"
EntryPoint="@(ApplicationManifest)"
Install="true"
OutputManifest="SimpleWinApp.application"
Product="SimpleWinApp"
Publisher="Microsoft"
SupportUrl="$(SupportUrl)"
UpdateEnabled="true"
UpdateInterval="3"
UpdateMode="Background"
UpdateUnit="weeks">
<Output
ItemName="DeployManifest"
TaskParameter="OutputManifest"/>
</GenerateDeploymentManifest>
<SignFile
CertificateThumbprint="$(Thumbprint)"
SigningTarget="@(ApplicationManifest)"/>
<SignFile
CertificateThumbprint="$(Thumbprint)"
SigningTarget="@(DeployManifest)"/>
</Target>
</Project>
This example uses the GenerateApplicationManifest task to generate a native manifest for application Test.exe, referencing native component Alpha.dll and an isolated COM component Bravo.dll.
This example produces the Test.exe.manifest, making the application XCOPY deployable taking advantage of Registration Free COM.
Note: |
|---|
In the example below, all application binaries are pre-built in order to focus on manifest generation aspects. This example produces a fully working
ClickOnce deployment.
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<File Include="Test.exe" />
<Dependency Include="Alpha.dll">
<AssemblyType>Native</AssemblyType>
<DependencyType>Install</DependencyType>
</Dependency>
<ComComponent Include="Bravo.dll" />
</ItemGroup>
<Target Name="Build">
<GenerateApplicationManifest
AssemblyName="Test.exe"
AssemblyVersion="1.0.0.0"
Dependencies="@(Dependency)"
Files="@(File)"
IsolatedComReferences="@(ComComponent)"
ManifestType="Native">
<Output
ItemName="ApplicationManifest"
TaskParameter="OutputManifest"/>
</GenerateApplicationManifest>
</Target>
</Project>