Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > ClickOnce problem: The application is signed with a different key than the existing application on the server
 

ClickOnce problem: The application is signed with a different key than the existing application on the server

I have a ClickOnce problem. I have searched the web and msdn blogs but have no conclusive answer and can’t fix the problem.

When I attempt to publish I get the following dialog (as attached):

---------------------------

Microsoft Visual Studio

---------------------------

The application is signed with a different key than the existing application on the server. Do you want to overwrite it?

---------------------------

Yes No Help

---------------------------


I am not sure what changes to the project properties cause this.


Now the thing is the Project settings have changed a bit, mainly I have now forced the platform target to x86 for all projects to solve a crystal report problem (when deploying to x64 machines), I need crystal release XI 2 to run in 32bit mode, I also changed the deploy path to our dev environment and now back again to the live path while testing. I don’t want to sign the application at all as this is just used internally. So before publishing on the project Properties I set the Signing settings tab and untick “Sign the Clickonce manifests�

Then I attempt to Publish. Every time I Publish I get the above dialog prompt and VS automatically creates the TemporaryKey.pfx (you can see in the solution explorer) and also sets the “Sign the Clickonce manifests�checkbox back to true, I cannot get the solution to publish without the signing checkbox unticked. This is very frustrating I’ve even tried manually editing the .csproj file deleting these lines:

<SignManifests>false</SignManifests>

<ManifestCertificateThumbprint>247708FAC1A406DB38D2A9AEC8749F1BBEBFDE7D</ManifestCertificateThumbprint>

<ManifestKeyFile>xxxxxx_TemporaryKey.pfx</ManifestKeyFile>

<GenerateManifests>true</GenerateManifests>

As suggested in this MSDN blog http://forums.msdn.microsoft.com/en/msbuild/thread/f2b8771a-902c-4a9d-a2e1-cc8044e54421/

And then setting the file to read only but no joy the “Sign the Clickonce manifests�checkbox gets autoset to true every time I Publish. I have even tried getting a fresh copy from Source Safe but it hasn’t helped. Also is there a quick way to force every project in my solution’s Build>Platform Target: to x86?

I not quite sure what is going on here but I definitely want to just publish the application as an update and not have to get every client machine to uninstall their current instance and reinstall this version as is the consequence detailed at this site http://msdn.microsoft.com/en-us/library/ms228673.aspx?ref=Klasistanbul.Com

Any help on this issue you can give me is much appreciated.

m3ntat  Tuesday, June 24, 2008 12:05 PM

You have to sign the deployment in order to use ClickOnce deployment. Go into the Signing tab and check the box and create a test certificate and use that. It will probably give a message when you deploy it, because it IS different from the one you used there.

You can try to track down the original certificate created and used -- try sorting the list of certificates in reverse order by date and pick the oldest one.

Note that if you are using VS2005, and you change the certificate, the users will have to deinstall and reinstall the application. They have fixed this problem in VS2008. There's a way around it by compiling and running a C++ program that someone wrote and deploying it as a prerequisite, but I don't think that's going to help you because of the next item on the list here...

As for the change of the platform target. If you change this, then it will tell you when you deploy it that you have changed it, because it changes the signature of the application. The user will have to deinstall and reinstall the application; updates won't work. There's no way around this (I have the same problem).

Just for further info, if you change the prerequisite of a ClickOnce application to a different version of the .Net Framework, or the target framework version (which you can do in VS2008), the users have to deinstall and reinstall, too.

If you don't want your users to deinstall and reinstall, you can't change the platform target to x86, and you have to track down the original certificate and use it instead of the one(s) VS keeps creating for you.

Good luck.

RobinS.

GoldMail.com

RobinDotNet  Wednesday, June 25, 2008 5:00 AM

You have to sign the deployment in order to use ClickOnce deployment. Go into the Signing tab and check the box and create a test certificate and use that. It will probably give a message when you deploy it, because it IS different from the one you used there.

You can try to track down the original certificate created and used -- try sorting the list of certificates in reverse order by date and pick the oldest one.

Note that if you are using VS2005, and you change the certificate, the users will have to deinstall and reinstall the application. They have fixed this problem in VS2008. There's a way around it by compiling and running a C++ program that someone wrote and deploying it as a prerequisite, but I don't think that's going to help you because of the next item on the list here...

As for the change of the platform target. If you change this, then it will tell you when you deploy it that you have changed it, because it changes the signature of the application. The user will have to deinstall and reinstall the application; updates won't work. There's no way around this (I have the same problem).

Just for further info, if you change the prerequisite of a ClickOnce application to a different version of the .Net Framework, or the target framework version (which you can do in VS2008), the users have to deinstall and reinstall, too.

If you don't want your users to deinstall and reinstall, you can't change the platform target to x86, and you have to track down the original certificate and use it instead of the one(s) VS keeps creating for you.

Good luck.

RobinS.

GoldMail.com

RobinDotNet  Wednesday, June 25, 2008 5:00 AM

You can use google to search for other answers

Custom Search

More Threads

• ClickOnce Application is Signed with a Different Key
• Accessing network database?
• Adding files to a Setup package based on wildcards
• unstall: uninstall/repair
• VB6 calling VS2005 exe ?
• Prerequisites failing to install
• Service application installation fail
• Can installer grant folder read/write permissions?
• Dynamically Modify Click Once Auto-Update URL?
• Bootstrapper editor