Build error with ClickOnce-Manifest in TFS Build - tfs

we try to build a .net vsto application on our buildserver.
The project build with a click once build manifest.
It works on two developer machines, when the certificate is installed. In build machine it doesn´t work:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\amd64\Microsoft.Common.CurrentVersion.targets(3090,5): Error MSB3326: Die folgende Schlüsseldatei kann nicht importiert werden: . Die Schlüsseldatei ist möglicherweise kennwortgeschützt. Importieren Sie das Zertifikat erneut, oder importieren Sie das Zertifikat manuell in den persönlichen Zertifikatspeicher des aktuellen Benutzers, um das Problem zu beheben.
EN:
error MSB3326: Cannot import the following key file: . The key file may be password protected. To correct this, try to import the certificate again or import the certificate manually into the current user's personal certificate store. [C:...csproj]
The certificate is installed on build machine.
Has anybody some idea how can I solve the problem?
Best regards

Try the solution in this case:
Login build agent machine using a build service account, open Developer Command Prompt for VS 2017 and cd to …\src\solutionname\projectname folder, then run sn -i xx.pfx VS_KEY_xxx and type password, after it is imported completely, close this Developer Command Prompt for VS 2017.

Related

Publish Failed to sign msix

Using Visual Studio 2019 to publish an update to an existing windows store application. This worked a week ago.
Our solution builds without error. When I go to create the setup package I get an error "Failed to sign 'D:\dev\MeyerMusic\MeyerTablet\TabletDistribution\bin\AnyCPU\Release\MeyerMusicTabletSetup_2.6.6.0_AnyCPU.msix'."
We are distributing the application as a Microsoft Store app under the existing app name.
Last week on this same development computer I built version 2.6.5 as well as many packages before that.
The error number is blank or missing. I do not have a reason for the failure. I only see one fact in the error message and that points to line 4574 in the file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets
That line is this:
<SignAppxPackage Condition="'$(AppxPackageSigningEnabled)' == 'true'"
AppxPackageToSign="$(AppxMainPackageOutput)"
CertificateThumbprint="$(PackageCertificateThumbprint)"
CertificateFile="$(PackageCertificateKeyFile)"
CertificatePassword="$(PackageCertificatePassword)"
HashAlgorithmId="$(AppxHashAlgorithmId)"
EnableSigningChecks="$(EnableSigningChecks)"
SignAppxPackageExeFullPath="$(SignAppxPackageExeFullPath)"
TempCertificateFilePath="$(TempCertificateFilePath)"
VsTelemetrySession="$(VsTelemetrySession)"
SigningTimestampServerUrl="$(AppxPackageSigningTimestampServerUrl)"
SigningTimestampDigestAlgorithm="$(AppxPackageSigningTimestampDigestAlgorithm)"
/>
Troubleshooting steps:
Attempted to build a side load package. Results in same error
Successfully built a side load package that was not signed
I have restarted Visual Studio
I have rebooted the machine
I have deleted OBJ, BIN for the entire solution
I have looked for errors in the event log but none have been found so far.
After uninstalling KB4535996 the problem was resolved.
I found this via a tip from the following post: https://developercommunity.visualstudio.com/content/problem/934967/uwp-error-failed-to-sign.html

Initial set up with TFS and VS Code on Windows with TEE-CLC

The reason why I'm using TEE CLC is because I'm trying to avoid downloading VS Community as I will be developing for work purposes. I was following this video Set up and Configure the TEE CLC on Linux but I got stuck after accepting the eula (2:43).
When I enter the command:
C:\...\TEE-CLC-14.0.3\tf.cmd workspaces -collection:http://[...]/tfs/DefaultCollection
I got the error message:
No workspace matching *;[my name] on computer [computer name] found in Team Foundation Server http://[...]/tfs/DefaultCollection.
Since I was able to accept the eula, I believe I am mapping to the right folder? I read in similar questions that it's a mapping issue. Am I misunderstanding? Does anyone have any ideas on what I'm doing wrong?
Thank you
It's not a error message, but a response to your command. At 4:02 in the video, after running export TF_AUTO_SAVE_CREDENTIALS=1, the command won't ask login any more. If you don't get login request, it mean your credential has been saved.
You could create a workspace first to see whether tf workspaces could list it:
tf workspace -new my_workspace

Jenkins Cannot import the following key file

I am able to build my application on Visual Studio without any problem. I am trying Jenkins out on the same machine. When I try to build my application from my git remote repository (It contains the .pfx file in the SVC) I get the error
error MSB3325: Cannot import the following key file: Key.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...
error MSB3321: Importing key file "Key.pfx" was canceled.
I had already run the command shown on the answer of this question Cannot import the keyfile 'blah.pfx' - error 'The keyfile may be password protected' and that is the reason my application runs in Visual Studio (I've done it through the command prompt as administrator fyi), which means when I try running it again the object already exists and if I uninstall and reinstall the same problem happens again.
Anyone has any ideas of how I can solve this problem?
Its the IIDentity (the windows account/identity) that is running Jenkins, most likely.
As a quick test, edit the Jenkins service and put in your credentials.
..
If that works, either keep it that way, or do your manual import voodoo using the identity that you want Jenkins to run under.

Netbeans 8 Tomcat 8 start error

I'm beginner with Java EE. I try to start my Tomcat server. I use this link to configuration.
At end if i start server i have an error message :
127.0.0.1 n'est pas une commande interne ou externe, un programme executable ou un fichier de commandes.
Anybody can help me. Please
Did you take a look of this post, Error starting Tomcat from NetBeans - '127.0.0.1*' is not recognized as an internal or external command ?
Quote from the post:
change
:noJuliConfig
set "JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%"
..
:noJuliManager
set "JAVA_OPTS=%JAVA_OPTS% %LOGGING_MANAGER%"
to
:noJuliConfig
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%
..
:noJuliManager
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_MANAGER%
I did what suggested in the post and it solved my problem.
If you are on Mac OS platform (could be valid for Linux environments as well, i did not try), another error appears in catalina.sh if IDE proxy is enabled. Debugging shows that below line gives an error.
Dhttp.nonProxyHosts=localhost|127.0.0.1|salvamea.local
To solve the error go to Server configuration "Platform" tab, and un-click "Use IDE proxy settings". For some reason if you need the proxy, then catalina.sh should be fixed so that the value is in double quotes.

how can I add my publisher name into my delphi exe program?

I do develop delphi programs that people do download.
Problem is when downloading them, they receieve an alert
"The publisher cannot be verified."
How can I add my publisher name into my delphi programs ?
You need a code-signing certificate, and need to digitally sign your executable using that certificate.
Search for [windows] code signing here at StackOverflow. There are tons of questions here on the topic; any and all of them (regardless of language used) for Windows applications apply to Delphi as well. Here is a start for you., and here's another one with links to resources. (Both links are here at StackOverflow, and not external sites.)
This is how I created a test certificate for my setup executable (produced by Inno Setup).
I used:
makecert -r -pe -ss MyCertStore -n "CN=MyTestCert" MyTestCert.cer
signtool sign /s MyCertStore /n MyTestCert MyApplication.exe
I could find these tools under:
"c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\"
Dont forget to install MyTestCert.cer under trusted providers, otherwise the MyApplication.exe will still show unknown publisher. Check with certmgr.exe which I could find in the same folder.
Worked for me on Win7x64.
For final signing you need a commercial code signing certificate, the cheapest I could find was from Comodo (about $70 a year).

Resources