which certificate is used by smartclient application - c#

I have an .net smartclient application OA.Smart.WinUI. I have three .pfx files listed in this project OA.Smart.WinUI_1_TemporaryKey.pfx,OA.Smart.WinUI_2_TemporaryKey.pfx,OA.Smart.WinUI_TemporaryKey.pfx. I want to know which out of these three is being used by this application. I can just find the details by clicking signing tab in properties.
I need this information as i want to change the config file on production server using mageUI.exe. For this i need to sign it again and there is no production certificate. So my understanding is that i need to publish one out of these three files and while signing use the one with which the application has been signed on the development machine.
Please help me out.

You can use MageUI and resign both of your manifest files on the production server. It doesn't matter what they were signed with originally.
I don't know what version of Visual Studio you are using, but in later versions you don't have to sign your manifests at all. That may be an option as well.

Related

Problem while signing my program in c# .NET Core VS2022

I created a PFX certificate with a free tool that works but when you import this certificate into a file, it will REQUIRE you to put a password. I know this password (of course since I created it) and VS tells me "Impossible to import... (path to the certificate (E:Certificates\xxx.pfx) <-- is an example)" and then it shows the container. I installed my key in this container (I used this page from another website), I restarted VS, rebuilt my application, re-imported the certificate and VS never liked me, it didn't work and now I'll find a way for people to trust me when you run the program for the first time, Windows SmartScreen will nag you (not really but find the "run" button, it's well able to hide it but easy to find if you click on the white link. ").
Information: My application is in .NET Core, my certificate is valid until 2032 (Yes yes, it's a lot but it's valid), it DOESN'T ask me for a timestamp server not like the .NET Framework, the minimum version to run is Windows 7 (7.0 (I need it for some reasons)). I searched deep... (seriously there)
I really tried to re-import the certificate, I just want the application to be signed. (Here's why I want to sign it: Later on (maybe but still possible), anti-viruses will start to fear more and more unsigned files so if in 2024 now to install an application it needs to be signed, it will help a lot).

VSTO Outlook Deployment - ClickOnce

I have written a very simple add-in that adds a button to the ribbon of outlook (C#).
I have spent days trying to get this very simple add-in to install on another machine using the clickonce method.
I have published clickonce to ftp using Visual Studio. All fine so far.
Upon running the resulting vsto (or setup.exe) on a different machine I am getting the error:
'System.Security.SecurityException: Customized functionality in this application will not work because the certificate used to sign the deployment manifest for Add-In or its location is not trusted. Contact your administrator for further assistance.'
I understand the idea behind a certificate being required to remove rogue add-ins being added to Outlook. I have signed the clickonce deployment using a test certificate on my machine.
Simply is it possible, without paying for a third-party certificate, to give a user the clickonce url and them install it without me having to do anything to their machine? (and/or domain etc.) This is ideally to be used by lots of enterprise users. Altering their environment isn't practical.
Many thanks.
Check your certificate chain. Most likely you need to place a copy of the certificate into:
Certificates - Current User\Trusted Root Certification Authorities
...so your "issuer" is trusted in order for your certificate to be trusted.

ClickOnce does not copy data file on update

We are experiencing this strange issue with one of our ClickOnce-deployed applications:
On some client machines, ClickOnce when updating the application does not copy the old database in the .pre folder.
ClickOnce updates the application, but it behaves like it is a new installation.
Another strange thing is that despite it is specified a minimum required version to force any client to update the client PCs which have this issue display the ClickOnce upgrade prompt (it also displays the "Restore the application to its previous state" in the control panel "Program and features" item).
Indeed, other client PCs upgrade automatically without prompting and ClickOnce update behaves like it should.
This is a mature application and this is our 30th publication.
Another element is:
Usually we published this application alternatively with two PCs but after installing Visual Studio 2012 we cannot use them to publish ClickOnce and then we create a virtual machine only for publishing this application.
--------------UPDATE----------------
I accepted RobinDotNet's solution because it is DAMN RIGHT to not rely on ClickOnce moving your data reliably.
I also found that you cannot rely on ApplicationDeployment.IsFirstRun.
I changed my code to use my internal check for IsFirstRun and now every updates run smoothly.
As you have found, you can not rely on ClickOnce moving your data reliably. I strongly recommend that you put your data in LocalApplicationData, even if it involves moving a database. Here is a blog article explaining exactly how to do that.
I suspect your problem (and that of not being able to use two different VS2012 instances) is because of the certificate that you use to sign your application. Is it a certificate purchased from a CA, or is it a test certificate created with VS2012? If it's a test certificate, then you probably created a new one on each machine, and each time you publish it, ClickOnce thinks you are changing the certificate, which is part of the identity. When the identity changes, it doesn't carry data forward, and thinks it's a new application. With .NET 3.5, they at least made it stop forcing all of your customers to uninstall and reinstall when you changed the certificate.
Your solution to that is to create one certificate and use it on one machine, then copy it to the other machine. Double-click on it to add it to the certificate store on the second machine, and be sure it's part of the project so you pick up the same one. (In the Signing tab, be sure to select the file, don't select it from the Certificate Store on the machine).

Deploying a .NET C# Console App

All,
I created a C# console app in VS2010 (.NET4). that hits a database and sends out emails.
It works fine when I run it from VS but deploying the app to a remote server has me befuddled. All I need to do is install this app on (1) remote windows server.
Should be easy, right?
Looking at the publish settings, I don't see anything that will just build it locally without creating an installer (From a CD-Rom or DVD-ROM) and the other 2 options really don't apply either, at least by their descriptions.
So here is what I did so far:
The VS2010 publishing options that I am given are as follows:
Step #1 Picked option 3
Step #2 Place generated files on remote server
Step #3 Ran the setup installer
Step #4 Get this error
Question
Am I approaching this correctly?
If not, what do I need to do?
Thanks
Notice the error:
The application requires that assembly office Version 12.0.0.0 be installed in the Global Assembly Cache (GAC) first.
Refer to this answer and this MSDN question which contains the answer I have quoted below:
We solved it by going into the Applications Files dialog under the publish tab of the Project's properties and changing the office.dll assembly to Include. It had previously been set to prerequisite (auto). --Dave3182
It looks like your application is leveraging Microsoft Office (2003, I think) COM objects. This will require the same version of Office to be installed on your server.
If you are leveraging Office format files (.doc, .docx, .xls, .xlsx for example), you can look into 3rd party libraries that allow you to create the formatted files without Office installed. If you are just using Outlook to send the emails, you should re-implement the feature using the .NET libraries instead.

ClickOnce Deployment online questions

Bit of a strange question, but how do ClickOnce deployments work from a web site? I seem to be having some problems with this. Basically, the setup file will download when you click the "install" button, but then some files are missing.
Do you need to be on a Microsoft server to run ClickOnce deployments? I usually do deployments over a local server with UNC, and as this is the first time I've done one online I'm struggling a bit.
Any newbie tutorials you can point me to would be great, and if I do need a special host for it, could you please recommend some?
Thanks for all the answers everyone :)
Are you going to the setup.exe file or the .application file?
Deployment has to be pointed to the .application file. The ClickOnce file will then be launched directly there, no explicit "Save as" download. Once the manifest is loaded, the application will download what it needs and off it runs.
The first thing you need to do is determine if you want the user installing your app to run locally or launching it from the web only.
Second make sure you are using Internet Explorer to launch your application. The .application is registered in IE, but not other browsers.
I'd recommend server only. (At least to start) You don't have to worry about incremental updates. The user will get the correct version of your program every time.
There is nothing special going on with the server. It's all in the browser/.application.
It works from any file server, for example here is a ClickOnce deployment from an SVN server (i.e. I'm checking in the ClickOnce files after each publish): http://o2platform.googlecode.com/svn/O2_ClickOnce_Installers/O2_XRules_Database
Can you provide more details on what settings you have on the Publish tab of your project?
Regarding missing files, yes it can be a pain since ClickOnce doesn't auto add all dependent files from sub projects (I have found in the past that you need to include the extra (non dlls) files you need in the project you are deploying via ClickOnce)
No special hosting requirements are needed. You just need to make sure all the files required by the published clickonce app are deployed.
Take a look here :
http://msdn.microsoft.com/en-us/library/31kztyey%28VS.80%29.aspx
You can deploy to a webserver using either FTP or HTTP. You need to have the following MIME types set up in order to host the deployment:
.application --> application/x-ms-application
.manifest --> application/x-ms-manifest
.deploy --> application/octet stream
If you are deploying .Net 3.5 as a prerequisite, you need these as well:
.msp --> application/microsoftpatch
.msu --> application/microsoftupdate
If you have vsto apps, you need this one:
.vsto --> application/x-ms-vsto
Check out the Application Files dialog in the Publish tab to see what files are included. You can try running the exe file from your \bin\release folder, but if it's using something in the Global Assembly Cache (GAC), it will work and not tell you you're missing it.
Here are some other helpful links:
ClickOnce Overview
http://msdn2.microsoft.com/en-us/library/142dbbz4(VS.80).aspx
HowTo publish a clickonce app
http://msdn2.microsoft.com/en-us/library/31kztyey(VS.80).aspx
RobinDotNet
Visit my ClickOnce blog!

Categories

Resources