certificate match error occurs when visual studio solution built - outlook

When i am building the solution in the visual studio, i got the following errors:
Cannot find the certificate that matches the project system thumbprint, To sign the application and deployment manifests, open the Project Designer, click the Signing page tab, select an existing certificate, and try again.
I have the certificate file.
How to resolve this?
Regards,
Brijesh

Related

ClickOnce application signed with purchased CA shows "Unknown Publisher"

I know this question has been asked a lot. I already tried many of the solutions in other questions, but is not working.
The application target framework is 4.5.2.
I'm working on Windows 7 with Visual Studio Community 2017.
The certificate is a code signing certificate from Sectigo. Standard version (not EV).
I'm using the Signing tab on Project properties to sign the application.
I'm publishing to a folder in my machine after that I upload the published files to a web server.
When I check the properties of the setup.exe and myApp.exe both are signed and timestamped correctly or at least it seems so.
Also, the myApp.application file in \path\publish_folder\, the \path\publish_folder\Application Files\myApp_1_0_0_0\myApp.application file and the \path\publish_folder\Application Files\myApp_1_0_0_0\myApp.exe.manifest have the <publisherIdentity> tag that matches with the certificate.
Everything seems good, even when I download the application and run the setup.exe I get the following warning, which is ok:
When setup.exe is executed is published is presented right but after the setup.exe calls myApp.application then it shows this warning with "Unknown Publisher" and that is the problem:
I tried installing the certificate in the "Trusted Root Certification Authorities" store, as well as in the "Trusted Publishers" store and in the "Personal" store, and publish the application again but the same thing happens.
In other questions said that the visual studio signing tab only sign the manifest but no the executable, as you can see this is not my case (setup.exe and myApp.exe have the digital signatures correctly) but even though I decided to try signing using signtool sign command (C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\signtool.exe) and build/publish events as theses answers proposed without luck:
.NET ClickOnce Signing results in "Unknown Publisher"
https://robindotnet.wordpress.com/2013/02/24/windows-8-and-clickonce-the-definitive-answer-2/
I think the only thing I'm missing to try is the "sign assembly" option (checkbox in Signing tab in Visual Studio), but when I do it the first time I get the error:
Cannot import the following key file: myKey.pfx. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_5578EF228F7A794C myApp
Then the second time I try I get this error:
Error importing key: An attempt was made to reference a token that does not exist
I signed the application and made the publish using Visual Studio Professional 2019 and it worked. Now it still shows the warning but with the publisher correctly in both warnings.

Cannot sign Click Once manifest with code signing certificate via VS options or using signtool

I have a C# Visual Studio 2013 solution (FindAlike) consisting of a number of projects. One of these projects (SimilarFiles) is a class library, including an AddIn Express component, as it implements an MS Office Add-in. When I publish the project as a ClickOnce installer an MS Add-in, a folder is created in the projects Publish folder with the version number of the project containing many files with extension .deploy. Also in the folder above are a file called findalike.application and one called setup.exe. If I copy the contents of the Publish folder to a new machine I can install the MS Add-in by clicking on findalike.application, but I receive a warning about an unknown publisher. If I confirm installation it proceeds satisfactorily.
I have a valid code signing certificate purchased from Comodo, which I use successfully with SignTool to sign a Windows Forms self-extracting installer from another project in the solution.
The option to sign the ClickOnce Manifest in the SimilarFiles project is greyed out, presumably because SimilarFiles is a class library project.
I can specify a code signing certificate by right-clicking on the SimilarFiles project and hovering over the Add-in Express entry and then selecting Signing Options, but the warning message still appears when I attempt the installation on a new machine
How can I use the code signing certificate in order to indicate to the ClickOnce installer on the new machine that the manifest is signed?
Signtool does not work on the setup.exe file, stating that it is not a valid Windows executable. Neither does it work on findalike.application
There is a Signing area on the VS Publish form which I'd missed. If I browse for my Code Signing Certificate (.pfx extension) and select SHA-1 only it signs OK, and install proceeds without warning. Thanks to Add-In Express for this solution.

VS 2005 Publish - Build Failed - SignTool reported 'Keyset does not exist' - System cannot find file specified (Exception from HRESULT:0X80070002)

VS 2005 Publish - Build Failed - SignTool reported 'Keyset does not exist' -
Facing this error while publishing VB application from VS 2005 ?
I have published my VB application zillion times without any issue but one fine day I ran into this sticky error. Despite of the signing certificate being there, visual studio was unable to find it. I guess this is one of those panic slow motion attacks that VS displays once in a while. After cracking my head for over two hours, finally resolved it without having to re-create a new solution from my application's forms n files, etc..as suggested on some sites.
Previously too I faced this error but I resolved it at that time by creating a new test certificate albeit I had to remove and re-install my application on client machines thereafter to take the new publish as this was a new certificate. This time Visual Studio didn't even allow me to create a new certificate. I got this nasty error when I tried - The System cannot find the file specified in visual studio (Exception from HRESULT:0X80070002). When I tried checking my certificates using certmgr.msc from Run command, I could see that my certificate was there in the Personal Store under Certificates of local current user. I also copied my certificate under trusted certificates folder but to no avail.
After doing four things my issue was finally resolved and I published my same solution happily again.
1. Close your solution. Delete the bin and obj folders of your solution. Remove the following tag lines from your .csproj file. Copy these four lines somewhere as backup.
<ManifestCertificateThumbprint>...</ManifestCertificateThumbprint><ManifestKeyFile>...</ManifestKeyFile><GenerateManifests>...</GenerateManifests><SignManifests>...</SignManifests>
Reopen your solution in VS and clean and re-build. Try Publishing after increasing the version number. It displays a different error that certificate is not found. Now close VS. Re-add those four lines back in the csproj file where they originally were in that file.
2. Reopen your project in VS and under Project Properties in Signing tab, uncheck the "Sign the Click Once manifests" and re-check again. Also do the same for Sign the assembly checkbox. Select the latest .pfx key. Save. Close and re-open Project Properties.
(This pfx is the key generated whenever we create a new certificate. Check the date of the .pfx in project folder to know which was the last one you had created and use that one. Personally I don't give any password while creating new certificate on expiry. )
Also, add your certificate that is present in Personal Store to the Trusted Certificate Store as well using the certmgr.msc console. Simply copy your VS application issued certificate from Personal Certificates folder to Trusted Root Certificates (if there exists a trusted root authority store) in the certificate Manager console panel - the screen that comes after typing certmgr.msc in run command.
3. Now Restart your system. Yes you read that right.
4. Open your project again in VS. Increase the version now and try Publishing. Voila, the publish goes fine.
PS : VS 2005 wakes up a bit late to changes made at manifest level. Also happens sometimes for crystal reports issues :( . So better give some time to reload VS after these changes. :) Step 1 is doing just that to remind visual studio that it needs a certificate and where it finds it usually in the local keystore. So keystore does not exist error does not make sense :) !
Note that I also tried importing my existing project certificate into the local pc's Personal certificate store (list of local store certificates can be checked in certmgr.msc from Run command) using MMC run command's console Snap-In but I get the error that Cryptographic Service Provider is needed to do so and that it is not installed on my system. Also, I can see my certificate is already present there in the Personal certificate store. Its just the Visual Studio forgot where and which one it is. I read somewhere that this can happen if there are too many / multiple publishes from the development machine. :D

ipa file is generated in the release mode but not in ad-hoc mode

I am trying to generate my ipa via Mac agent in Visual Studio. When I choose the release mode, it is ok and the Visual Studio shows me this message:
The ipa file should be visibile on the build server.
But when I try it in ad-hoc mode, it just tells me this error:
ipa file was not generated. please check the project configuration
I tried the different solutions, for example, I change some configurations in info.plist. But the error is still there. Do you have any suggestion?
Ensure that you have enabled the build in the project configuration.
open project properties
select iOS IPA Options
change configuration to Ad-Hoc
change platform to iPhone
enable Build ad-hoc/enterprise package (IPA)
After investigating the problem for some hours I found - in my case - there were some problem with my Apple developer account handling in Visual Studio and that's why VS could not find any certificates to sign / generate ipa.
So, pls check your Apple developer account settings in VS options (Tools/Options/Xamarin/Apple accounts) After reentering my credentials IPA is generated in my case.

Signing a Windows application given a .SPC file?

My client wants to sign the application code. He gave me an .spc file for signing a .NET desktop application. How should I use it within the app?
Thanks
http://ellisweb.net/2008/08/signing-code-using-pvk-and-spc-files/
Got a simple option.Install your spc file.
Go to Internet explorer=>tools=>content=> certificates.Then select your certificate and click export option.you can generate Pfx file.
then you can set this pfx file in the signing tab of the project properties from visual studio
You sign the assembly before you send it to your customer. You can do this automatically in Visual Studio in the project settings.

Resources