Test Case 1: Fails with Clickonce Published executables

Test case 1 requires the executables have an embedded manifest specifying the required executaion level. I am using the Visual Studio 2005 ClickOnce for deploying my application. I have a postbuild event as below to embed the manifest into my exe.

The problem is my clickonce application fails to install if the exe contains an embedded manifest. Below is the log information of the error. Please help fix this issue.

Following errors were detected during this operation.
* [3/6/2007 12:23:11 PM] System.Deployment.Application.InvalidDeploymentException (RefDefValidation)
- Reference in the manifest does not match the identity of the downloaded assembly BancAssuranceClient.exe.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.DownloadManager.ProcessDownloadedFile(Object sender, DownloadEventArgs e)
at System.Deployment.Application.FileDownloader.DownloadModifiedEventHandler.Invoke(Object sender, DownloadEventArgs e)
at System.Deployment.Application.FileDownloader.OnModified()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)

COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.

[2409 byte] By [mahalax] at [2008-1-4]
# 1
Does the exe work no problem without clickonce install? You should get an error message if the manifest has a problem.
OliverLundt-LN at 2007-10-11 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 2
What does your manifest look like?
BruceN.Baker-MSFT at 2007-10-11 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 3

I am able to run the executable as administrator directly (from the published folder) after embedding the manifest. Vista also puts the shield icon overlay for the executable after I embedded the manifest.

The problem arises only when I install using the Applicationname.application through clickonce. The error messages is as below:

PLATFORM VERSION INFO
Windows : 6.0.6000.0 (Win32NT)
Common Language Runtime : 2.0.50727.312
System.Deployment.dll : 2.0.50727.312 (rtmLHS.050727-3100)
mscorwks.dll : 2.0.50727.312 (rtmLHS.050727-3100)
dfdll.dll : 2.0.50727.312 (rtmLHS.050727-3100)
dfshim.dll : 2.0.50727.312 (rtmLHS.050727-3100)

SOURCES
Deployment url :
file:///D:/Build/Client/BancAssuranceClient_1_0_0_30.application
Application url : file:///D:/Build/Client/BancAssuranceClient_1_0_0_30/BancAssuranceClient.exe.manifest

IDENTITIES
Deployment Identity : BancAssuranceClient.application, Version=1.0.0.30, Culture=en, PublicKeyToken=e010b2fc084cad0a, processorArchitecture=msil
Application Identity : BancAssuranceClient.exe, Version=1.0.0.30, Culture=en, PublicKeyToken=e010b2fc084cad0a, processorArchitecture=msil, type=win32

APPLICATION SUMMARY
* Installable application.

ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of D:\Build\Client\BancAssuranceClient_1_0_0_30.application resulted in exception. Following failure messages were detected:
+ Reference in the manifest does not match the identity of the downloaded assembly BancAssuranceClient.exe.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.

WARNINGS
There were no warnings during this operation.

OPERATION PROGRESS STATUS
* [3/7/2007 3:14:06 PM] : Activation of D:\Build\Client\BancAssuranceClient_1_0_0_30.application has started.
* [3/7/2007 3:14:06 PM] : Processing of deployment manifest has successfully completed.
* [3/7/2007 3:14:06 PM] : Installation of the application has started.
* [3/7/2007 3:14:06 PM] : Processing of application manifest has successfully completed.
* [3/7/2007 3:14:08 PM] : Request of trust and detection of platform is complete.

ERROR DETAILS
Following errors were detected during this operation.
* [3/7/2007 3:14:09 PM] System.Deployment.Application.InvalidDeploymentException (RefDefValidation)
- Reference in the manifest does not match the identity of the downloaded assembly BancAssuranceClient.exe.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.DownloadManager.ProcessDownloadedFile(Object sender, DownloadEventArgs e)
at System.Deployment.Application.FileDownloader.DownloadModifiedEventHandler.Invoke(Object sender, DownloadEventArgs e)
at System.Deployment.Application.FileDownloader.OnModified()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)

COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.

My manifest is:

<?xml version="1.0" encoding="utf-8" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.2622.26898" processorArchitecture="X86" name="BancassuranceHost" type="win32" />
<description>Bancassurance Client</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

The assembly version specified in the ablove manifest and the version of the actual executable match. Please help.

mahalax at 2007-10-11 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 4

Do you get the same problem if it you have it "asInvoker"?

I'm not sure if clickonce can elevate to administrator... I never tried it!

OliverLundt-LN at 2007-10-11 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 5

Yes, I get the same problem even if I have it as "asInvoker".

I have tried the manual way of creating application and deployment manifests(using mage tool). Still I get the same error.

My manifest is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">

<assemblyIdentity version="1.0.0.0"

processorArchitecture="X86"

name="TestManifestClickOnce"

type="win32"/>

<description>Description of your application</description>

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">

<security>

<requestedPrivileges>

<requestedExecutionLevel

level="requireAdministrator"

uiAccess="false"/>

</requestedPrivileges>

</security>

</trustInfo>

</assembly>

mahalax at 2007-10-11 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 6
Double check what name your using in the manifest, it sounds like this isn't matching.
BruceN.Baker-MSFT at 2007-10-11 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 7

We double-checked the manifest we are using for our application. The name in the manifest and the name of the application match. I think I posted the manifest which we use to try with a sample application before we tried with our actual application, else the content is the same.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">

<assemblyIdentity version="1.0.2622.26898"

processorArchitecture="X86"

name="BancassuranceClient"

type="win32"/>

<description>Description of your application</description>

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">

<security>

<requestedPrivileges>

<requestedExecutionLevel

level="requireAdministrator"

uiAccess="false"/>

</requestedPrivileges>

</security>

</trustInfo>

</assembly>

mahalax at 2007-10-11 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 8

is this correct type="win32"

I think there is a different value for managed code. Not sure if your app is managed? I don't think type is required so maybe try leaving it off too...

name="BancassuranceClient" Name requires the .exe on I believe.

processorArchitecture="X86" and version="1.0.2622.26898" are also not required, try leaving them off to.

Try my recomendations one at a time to figure out which is the solution. Good Luck

OliverLundt-LN at 2007-10-11 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 9

I'm having the same issue.. if you include manifests in this manner

http://community.bartdesmet.net/blogs/bart/archive/2006/10/28/Windows-Vista-_2D00_-Demand-UAC-elevation-for-an-application-by-adding-a-manifest-using-mt.exe.aspx

On a clickonce app, it will fail to run at all. As a matter of fact, in order to do an embedded manifest in the above manner (URL above) you must change the name of the manifest to something else (manfiest.xml) and then alter your post-build to

"$(DevEnvDir)..\..\SDK\v2.0\bin\mt.exe" -manifest "$(ProjectDir)manifest.xml" –outputresource:"$(TargetDir)$(TargetFileName)";#1

Otherwise you get a nasty build error as in below

Error 3 "Properties\app.manifest;MYAPPNAME.exe.manifest" is an invalid value for the "BaseManifest" parameter of the "GenerateTrustInfo" task. Multiple items cannot be passed into a parameter of type "Microsoft.Build.Framework.ITaskItem".

But if I do it the manifest.xml way above, it DOES build, and the app DOES have the little shield over it, but when you run it, the error comes up:

MYAPPNAME has stopped working

Windows is collecting more information about the problem. This might take several minutes.

cdengler at 2007-10-11 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 10

Hi Oliver,

Yes, my application is a C#/WPF application. I ahve tried your recommendations with all possible combinations, in vain.

I have a doubt whether the there is a conflict between the UAC manifest we embed into the exe and the application manifest used to deploy the application, since both try to define the security/trustinfo for the same application.

mahalax at 2007-10-11 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 11

Any solution please...

Thanks.

mahalax at 2007-10-11 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 12
Has this been resolved?
BruceN.Baker-MSFT at 2007-10-11 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 13

For now, we are have included the UAC information into the external manifest(the application manifest) and it is working. Though we are not sure whether this is the right solution.

Thanks.

mahalax at 2007-10-11 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 14
Just delete your application_name.exe.manifest from the debug folder and compile again
rahou at 2007-10-11 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...

Software Development for Windows Vista

Site Classified