Error deploying ClickOnce application - Reference

2019-01-07 05:11发布

I'm trying to deploy a ClickOnce application, but installation fails on the client. Here's the error log:

PLATFORM VERSION INFO
Windows             : 6.1.7601.65536 (Win32NT)
Common Language Runtime     : 4.0.30319.1
System.Deployment.dll       : 4.0.30319.1 (RTMRel.030319-0100)
clr.dll             : 4.0.30319.1 (RTMRel.030319-0100)
dfdll.dll           : 4.0.30319.1 (RTMRel.030319-0100)
dfshim.dll          : 4.0.31106.0 (Main.031106-0000)

SOURCES
Deployment url          : http://MyProduct.com/download/workstation/MyProduct%20Front%20Desk.application
                    Server      : Microsoft-IIS/7.5
                    X-Powered-By    : ASP.NET
Deployment Provider url     : http://MyProduct.com/Download/Workstation/MyProduct%20Front%20Desk.application
                    Server      : Microsoft-IIS/7.5
                    X-Powered-By    : ASP.NET
Application url         : http://MyProduct.com/Download/Workstation/Application%20Files/MyProduct%20Front%20Desk_1_0_0_7/MyProduct%20Front%20Desk.exe.manifest
                    Server      : Microsoft-IIS/7.5
                    X-Powered-By    : ASP.NET

IDENTITIES
Deployment Identity     : MyProduct Front Desk.application, Version=1.0.0.7, Culture=neutral, PublicKeyToken=df343a0868ab2d74, processorArchitecture=msil
Application Identity        : MyProduct Front Desk.exe, Version=1.0.0.7, Culture=neutral, PublicKeyToken=df343a0868ab2d74, 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 http://MyProduct.com/download/workstation/MyProduct%20Front%20Desk.application resulted in exception. Following failure messages were detected:
    + Reference in the manifest does not match the identity of the downloaded assembly MyProductSiteServer.exe.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.

WARNINGS
There were no warnings during this operation.

OPERATION PROGRESS STATUS
* [03/17/11 11:51:04] : Activation of http://MyProduct.com/download/workstation/MyProduct%20Front%20Desk.application has started.
* [03/17/11 11:51:04] : Processing of deployment manifest has successfully completed.
* [03/17/11 11:51:04] : Installation of the application has started.
* [03/17/11 11:51:05] : Processing of application manifest has successfully completed.
* [03/17/11 11:51:06] : Found compatible runtime version 4.0.30319.
* [03/17/11 11:51:06] : Request of trust and detection of platform is complete.

ERROR DETAILS
Following errors were detected during this operation.
* [03/17/11 11:51:30] System.Deployment.Application.InvalidDeploymentException (RefDefValidation)
    - Reference in the manifest does not match the identity of the downloaded assembly MyProductSiteServer.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.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, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
        at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)

COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.

The main exe I need to deploy is MyProductFrontDesk.exe, which has a dependency on MyProductSiteServer.exe - and that appears to be where the error is being thrown: "Reference in the manifest does not match the identity of the downloaded assembly MyProductSiteServer.exe."

Which manifest needs to be corrected? And how?

16条回答
做个烂人
2楼-- · 2019-01-07 05:40

ALSO SOLVED FOR ClickOnce .exe calling .exe calling .exe.

I had this problem also, using VB.NET in Visual Studio 2010.

I have a ClickOnce Windows Forms application that references a second Windows Forms application that in turn references a third Windows Forms application. (These second and third applications are EXE files rather than DLL file for simplicity, as they are equally likely to be run stand-alone or called with properties passed to them.)

I had to comment out BOTH the second and third applications' manifest contents per:

Walkthrough: Manually Deploying a ClickOnce Application

It works perfectly.

查看更多
3楼-- · 2019-01-07 05:42

I had the same issue, and I tried all of previous suggested solutions here, and all of them didn't work.

I fixed it by changing the update location. From project properties -> Publish -> Updates. Change the update location to your published folder.

查看更多
做自己的国王
4楼-- · 2019-01-07 05:43

There was an issue with Visual Studio 2008 which is solved by not embedding the default manifest - one of the comments on that article suggests the problem still exists in Visual Studio 2010.

In project properties -> Application tab -> Resources -> checkbox Icon and manifest, the setting "Embed manifest with default settings" caused the problem. Setting it to "Create application without a manifest" fixes the problem.

查看更多
We Are One
5楼-- · 2019-01-07 05:44

It is interesting. I just redeploy the application and problem solved. Maybe a file corruption because of network.

查看更多
地球回转人心会变
6楼-- · 2019-01-07 05:46

I had a bit of a different problem that I was able to resolve and so I wanted to post. My issues was I was running 3 branches out of TFS. I had upgraded Telerik controls in one of my branches but not the others. Once I upgraded the Telerik controls in all 3 branches and re-published it worked and this error went away.

I was running VS2015 at the time.

查看更多
Animai°情兽
7楼-- · 2019-01-07 05:48

Another workaround, in case the dependency exe with the bad app manifest cannot be changed (say coming from a NuGet package). The binary can be included as content with a dummy extension so ClickOnce does not try validating the manifest and then renamed during app startup.

csproj:

  <Content Include="..\packages\<package>\lib\<app>.exe">
    <Link><app>.exe.bin</Link>
    <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  </Content>
  <ItemGroup>
    <PublishFile Include="<app>">
      <Visible>False</Visible>
      <Group>
      </Group>
      <TargetPath>
      </TargetPath>
      <PublishState>Exclude</PublishState>
      <IncludeHash>True</IncludeHash>
      <FileType>Assembly</FileType>
    </PublishFile>
  </ItemGroup>

App.xaml.cs:

public partial class App : Application
{
    private void Application_Startup(object sender, StartupEventArgs e)
    {
        var appDir = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
        if (!File.Exists($"{appDir}\\<app>.exe"))
        {
            File.Copy($"{appDir}\\<app>.exe.bin", $"{appDir}\\<app>.exe");
        }
    }
}
查看更多
登录 后发表回答