121

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?

2
  • Is the MySiteServer.exe project in the same Visual Studio solution as MyProductFrontDesk.exe? If so, does your build configuration have both assemblies selected to build?
    – Jay
    Commented Mar 17, 2011 at 10:43
  • @Jay - yes, in same solution, both selected to build.
    – Shaul Behr
    Commented Mar 17, 2011 at 10:56

24 Answers 24

125

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.

7
  • I found comment 488301 particularly useful: the <assemblyIdentity/> element in the custom manifest can be adjusted (or omitted to let the compiler emit the correct assembly identity) in your custom .manifest file, enabling one to specify things like <requestedExecutionLevel/> without breaking ClickOnce.
    – binki
    Commented Aug 21, 2013 at 15:32
  • 5
    My scenario was a GUI app that needs a 2nd app that is a console app. If like me you'd rather not change the default settings, manually publishing that 2nd application created an app.manifest that appeared in the Properties folder, then publishing again the 1st application worked without having to change the default settings of embedding a manifest.
    – aybe
    Commented Jan 10, 2014 at 17:24
  • 7
    Had the same problem with VS 2013. This solution worked.
    – EagleBeak
    Commented Jul 8, 2014 at 13:52
  • 2
    @EagleBeak where is this menu in VS2013? I dont see anything about "creating application without manifest"
    – Nefariis
    Commented Apr 23, 2015 at 17:52
  • 3
    As of June 2016, the correct answer is to configure ClickOnce Security Settings (see answer posted by Mauro). Commented Jun 4, 2016 at 5:24
73

I had the same issue when I added a reference to another project.

The way to solve this was enabling ClickOnce Security Settings in all referenced projects as Ian explained here (emphasis mine):

For me, the way this was resolved was to ensure that all the Projects under the Solution which exposed the "Security Tab" in their "Project Properties" had the Option "Enable ClickOnce Security Settings" Ticked with the Option "This is a full trust application" Selected. This has to do with creating the Manifest correctly and the application will not install if these options are not set on all the Projects within the Solution that require it.

I believe this is the proper way to fix it when making a reference to another project under the same solution.

The linked forum post has expired by now, but it's available on archive here.

3
  • 1
    After trying so many solutions only this solution works for me. So I also think this should be the accepted answer...
    – Tareq
    Commented Jan 6, 2017 at 12:40
  • You can do the same with modifying the .cproj file with <PropertyGroup><TargetZone>LocalIntranet</TargetZone></PropertyGroup>
    – VMAtm
    Commented Apr 5, 2017 at 17:46
  • I had disabled those two settings while I was fooling around with https://github.com/Squirrel. When my (non-production) ClickOnce deploys stopped working, I had forgotten all about this. Commented Oct 16, 2018 at 20:45
39

I was encountering the same problem, but my solution was very different.

My ClickOnce application was referencing another EXE file project in my solution, so when the client downloaded it, and there was another EXE file, that one didn't have a manifest.

Removing the dependency on another executable solved my problem.

6
  • 2
    I also have two EXEs. Removing the dependency excludes the refferenced EXE from the build. Is there a way to include it? Commented Apr 17, 2013 at 17:12
  • 11
    This was the solution for me. One of the projects my main EXE was referencing was itself a 'Windows Application'. When I changed that project to 'Class Library' and republished, everything worked.
    – Chris Ray
    Commented Apr 25, 2013 at 18:49
  • I used @ChrisRay 's suggestion in VS2012, and the program installed without any difficulty. Thanks!
    – Rolan
    Commented Apr 2, 2015 at 17:10
  • 1
    as user @Aybe mentions in another answer's comments, if you dummy publish the second application, it will get its own manifest and then you can publish the first application and both programs will work together. (In my case I have two programs, one which calls the other.) Commented Sep 28, 2017 at 23:36
  • The solution for me was really both (this and @stuartd) - I do have an EXE as a reference assembly, which doesn't have a manifest. But I can't "remove" this reference because I need to use it. So I had to go to the project of this EXE dependency, apply stuartd's suggestion. Then everything works great.
    – KFL
    Commented Feb 27, 2018 at 5:28
12

I confirmed that the issue also exists in Visual Studio 2010. Selecting "Create application without a manifest" in Project Properties - Application - Resources solved the problem.

1
  • 8
    Just a note that I had to change this property on the project that the error message was complaining about, which for me was a project being referenced by the project that I was actually trying to publish, not the project that I was actually trying to publish.
    – deadlydog
    Commented Feb 8, 2013 at 16:28
6

I have experienced the same error when deploying with the project set to Debug. When it was changed back to Release there was no error.

6

This can also happen if you have two different versions of a NuGet package referenced in different DLL files in your project. In my case I was using a framework called Catel, and I had a newer version referenced in one DLL file than another (oversight), but this caused ClickOnce to spit out this error. Referencing the same version resolved the problem.

0
5

I had exactly the same issue. I could not remove the dependency as it was needed by the main project. The second project was a console project.

I changed to Class Library, and then it all worked.

1
  • This comment fixed my problem. Thank you!
    – casaout
    Commented Sep 24, 2015 at 6:35
4

I had the same problem, but my solution was to change the 'Platform target' to 'x86' (Project Properties -> Build Tab). It was set to Any CPU. As soon as I changed the setting and republished, the ClickOnce installer was able to complete.

1
  • 1
    Very similar issue: I had "Prefer 32-bit" enabled; turning it off fixed the problem. Commented Apr 5, 2016 at 13:42
3

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.

1
  • this solved the problem for me. any idea of the reason?
    – Nedo2490
    Commented Feb 16, 2021 at 17:57
2

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");
        }
    }
}
2

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.

0
2

If you have one main program that references another then you have to do the "Create application without a manifest" trick on the main program's Program:

Project --> Properties --> Application Tab -->Resources --> Manifest -->drop down "Create application without a manifest"

and then switch over to the referenced program's Project Properties and repeat the process.

1
  • You did the trick, Thanks Commented Oct 21, 2021 at 10:26
2

I had the same issue a couple of minutes ago, and below are the steps that I used to solve it.

Key

  • a = Main project (the project you want to publish, e.g. myProduct)
  • b = Reference project (e.g. MyProductSiteServer)

Checklist

  1. Navigate to properties -> Application -> Resources -> check icons and manifest (for both a and b)

  2. Navigate to properties -> Build : make sure that a and b are on the same target platform

  3. Navigate to properties -> Security and make sure that a and b have these settings checked: "Enable ClickOnce security settings" and "This is a full trust application"

  4. Navigate to properties -> Publish : I recommend you change the path of the publishing folder

1
  • #3 did the trick for me
    – mack
    Commented Nov 10, 2021 at 10:29
1

I use mage.exe to generate my manifest. Adding this to my .csproj fixed the issue. You may also try the -nowin32manifest compiler flag; I've not tested it. I don't see stuartd's "Create application without a manifest" in Visual Studio 2017; I think this is what it does though.

<PropertyGroup>
  <NoWin32Manifest>true</NoWin32Manifest>
</PropertyGroup>

I also have this in my .csproj:

<GenerateManifests>false</GenerateManifests>
1
  • 1
    A bit of additional information from someone who struggled to deploy ClickOnce using dotnet tooling: This is one of the (probably many) ways that you can get this error. You can determine if a Win32 manifest is the problem by opening the offending .exe file in Visual Studio and select Open With... and select Resource Editor. If it contains an RT_MANIFEST resource then ClickOnce will fail. To get rid of this resource add <NoWin32Manifest>true</NoWin32Manifest> to .csproj as explained in this answer. Commented Jan 18, 2021 at 13:50
1

I had this exact same issue with my VS 2019 application.

I have tried creating the application without a manifest however that did not work.

What did work however was the following:

  1. Go to Build-->Publish-->Application
  2. Click on the "Assembly Information" button
  3. Tick the "Make assembly COM-Visible" option

Hopefully, this helps!

1

it seems like the issue is caused by the setup.exe in vs 2019. it seems that the exe won't update its version when doing a new deployment. the workaround for me is to

  1. delete everything in the deployment folder.
  2. uncheck "Create setup program to install prerequisite components" in Properties => Publish => Prerequisite.
  3. do a deployment.
  4. come back and re-enable "Create setup program to install prerequisite components". guess this process will force vs 2019 to update setup.exe to the correct version.

also Project --> Properties --> Application Tab -->Resources --> Manifest -->drop down "Create application without a manifest" will work but the app won't update if there is a newer version so I have to fall back to the workaround above.

0
1

I faced the same, So whenever you update an assembly , In my case I was downgrading from CR For .Net framework 4.0 to Framework 2.0 , I replaced all referenced assemblies with the old one , The project runs fine but in order to publish

YOU MUST CLEAN WHOLE SOLUTION

then rebuild all , then publish it will solve the problem.

Thanks

0

I am using Visual Studio 2012 on Windows 7 and need to publish a solution consisting of two projects.

As Eduardo pointed out, marking both projects as ClickOnce, and enabling Full Trust Application resolves the problem.

0

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.

0

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

0
0

In my version of Visual Studio 2017, version 15.6.6 (but it may been have there earlier) I found that the Application Files was not in the Right Click Exe Project and Publish, but under the Project Properties Publish Tab where you can set which of the Application Files that you want to to be put in the install.

So take out the ones that are a problem. If something is already installed on a computer where this app will be installed, there is no reason to try to reinstall it anyways, except if you need the reference for it to run. If it were to install what was already on the pc, but to a different folder it might not work. It is best to use the other applications or dll assemblies to the same location as they were previously installed.

0

In my case 2 exe projects in a solution had .NET target set to 4.8 and 4.6.1. After I set both to 4.8, the error stopped.

2
  • 1
    There are twenty-one existing answers to this question, including a top-voted, accepted answer with over one hundred votes. Are you certain your solution hasn't already been given? Commented Dec 25, 2021 at 0:50
  • @JeremyCaney Yes. I checked all others, didn't found a solution then found one myself. Commented Jul 14, 2022 at 14:33
0

I am Using Visual Studio 2022 and the error came up. Solved it by excluding Log4Net file in the Publish > Application Files.

and the error Stopped

0

For reference, I've recently encountered this error and, in my case, it turns out we had published a WPF application as a NuGet package. Moving the code to a class library project solved the problem.

Not the answer you're looking for? Browse other questions tagged or ask your own question.