I'm building a C# SSL software, and it worked just fine when I first generated certificate using openssl, and eveything was good, until I reebooted my PC and ran the program again. In the line:
clientSslStream.AuthenticateAsServer(serverCert,clientCertificateRequired: false, checkCertificateRevocation: false);
was the error System.ComponentModel.Win32Exception: 'The credentials supplied to the package were not recognize'
I tried to reinstall the SAME certificate again and restart the program and it worked just fine.
after rebooting again, the program threw this error again. How can I solve the error forever? I'm using default windows certificate importer, and allowing every program to read the private key. I've imported both *.p12 and *.crt files but it wasn't matter. How can I solve the problem?
Here are some screenshot from mmc, on for the certificate on local PC account and the other for User PC account. The screenshots are after reboot, when it doesn’t work:
The answer: In windows, after installing certificate you have to add valid user (e.g: Aviv, Admin..) to keep the certificate installed.
Source: Answer in serverfault
Related
We had a Jenkins job running without issues for a couple of months now but recently it started failing.
It has this error when running form Jenkins:
CSC : error CS7028: Error signing output with public key from container 'Container_ID' -- The file exists. [lgw0hqij.tmp_proj]
It seems to rename the file every time.
I have logged into the host and executed as the user but it gives no error when running normally.
Once I run the user as an administrator, it starts giving the issue.
Running the application from Visual Studio does not give an issue at all!
I have tried running Jenkins as a LocalService as well as a lower privileged user, but same result.
I have also followed this, but doesn't seem to help.
I'm running out of ideas
EDIT
For anyone facing the same issue in the future. This error is linked to the user account temp folder
C:\Users\<username>\AppData\Local\Temp
Once you clear this folder, your msbuild should be working fine
For anyone facing the same issue in the future. This error is linked to the user account temp folder
C:\Users\<username>\AppData\Local\Temp
Once you clear this folder, your msbuild should be working fine
I am publishing my application with HTTPS setup url and host it to HTTPS url.
When I run setup.exe an error occurred.
An error occurred trying to download 'https://***.tjc.tv/WMSClient.application'.
See the setup log file located at 'C:\Users\mkumawat\AppData\Local\Temp\VSD3796.tmp\install.log' for more information.
Log file
The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [InstallMode] = HomeSite {string}
Property: [ProcessorArchitecture] = AMD64 {string}
Property: [VersionNT] = 6.2.0 {version}
Running checks for package 'Windows Installer 3.1', phase BuildList
The following properties have been set for package 'Windows Installer 3.1':
Running checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '3.1': true
Result of checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe' is 'Bypass'
'Windows Installer 3.1' RunCheck result: No Install Needed
Launching Application.
URLDownloadToCacheFile failed with HRESULT '-2146697202'
Error: An error occurred trying to download 'https://***.tjc.tv/WMSClient.application'.
When I manually download this https://***.tjc.tv/WMSClient.application in browser then it's downloading and works fine but in setup.exe it's not working.
I have already tried following solutions but nothing works.
Enable - Launching applications and unsafe files in Custom level in Internet options.
Uncheck - Warn if changing between secure and not secure mode in advanced tab in Internet options.
Sign the ClickOnce Manifests in project properties in VS
But these all are failing nothing works.
This issue occurs with only HTTPS not HTTP. HTTP is working fine but I need to use HTTPS.
SSL certificate is valid.
Anyone know about this.
On our systems setup.exe failed as well, with the error URLDownloadToCacheFile failed with HRESULT '-2146697208', while, when clicking on the ourapp.application link or launching the downloaded file, the applicaction installed with no issue.
If we changed the install source from HTTPS to HTTP, we would then be able to install using setup.exe.
Our resolution was to re-enable the caching of HTTPS pages. Since setup.exe is using WinInet, this is an Internet Settings change that can be made thru IE.
In Internet Explorer, go to Tools/Internet options
Switch to the Advanced tab and scroll down to the Security section.
Un-check the item “Do not save encrypted pages to disk”.
Since most traffic is moving to HTTPS, this security feature doesn't make much sense to me anymore
I am trying to get TeamCity to Build my VisualStudio2015 c# solution.
However I keep getting this error on TeamCity on the server.
Cannot import the following key file: XXX.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: YYY
This also occures when I use MSBuild to build the project direct from the commandline on the server.
I have googled and found the answer that suggests running the command "sn -i XXX.pfx YYY"
This command runs sucessfully. However this does not fix the issue and I still get the error.
I have also tried double clicking on XXX.pfx and installing the certificate that way. As with the command line, it says it has been installed but the build still fails for the same reason.
Are there any other things I can try?
I'm trying to create a C# console application using SignFile lib to access Token USB (contain Digital Signature) to sign a folder of PDF files.
The problem is after build Release to run on Windows Server 2012, this application run successful without any error (with Administrator account). But when I try to run with remote in my laptop (using Administrator account too), this application run error with this code:
Unhandled Exception : System.Security.Cryptography.CryptographicException: Bypassing PIN exception: An internal error occured
Anyone got any ideas about this situation?
I am a little desperate. I have been trying to resolve the following issue for hours.
I have developed an app which I now tried to install by using Visual Studio 2015's Setup Wizard Extension. Everything is building or (no errors) but when I open the app it highlights that it can only open in the context of an app container. What does that mean? Any advice would be highly appreciated!
The app is working with an SQlite database. Could this have something to do with the dependencies? If so, how could I approach fixing this?
UPDATE:
# Culture = "en-US"
ConvertFrom-StringData #'
###PSLOC
PromptYesString = &Yes
PromptNoString = &No
BundleFound = Found bundle: {0}
PackageFound = Found package: {0}
CertificateFound = Found certificate: {0}
DependenciesFound = Found dependency package(s):
GettingDeveloperLicense = Acquiring developer license...
InstallingCertificate = Installing certificate...
InstallingPackage = \nInstalling app...
AcquireLicenseSuccessful = A developer license was successfully acquired.
InstallCertificateSuccessful = The certificate was successfully installed.
Success = \nSuccess: Your app was successfully installed.
WarningInstallCert = \nYou are about to install a digital certificate to your computer's Trusted People certificate store. Doing so carries serious security risk and should only be done if you trust the originator of this digital certificate.\n\nWhen you are done using this app, you should manually remove the associated digital certificate. Instructions for doing so can be found here: http://go.microsoft.com/fwlink/?LinkId=243053\n\nAre you sure you wish to continue?\n\n
ElevateActions = \nBefore installing this app, you need to do the following:
ElevateActionDevLicense = \t- Acquire a developer license
ElevateActionCertificate = \t- Install the signing certificate
ElevateActionsContinue = Administrator credentials are required to continue. Please accept the UAC prompt and provide your administrator password if asked.
ErrorForceElevate = You must provide administrator credentials to proceed. Please run this script without the -Force parameter or from an elevated PowerShell window.
ErrorForceDeveloperLicense = Acquiring a developer license requires user interaction. Please rerun the script without the -Force parameter.
ErrorLaunchAdminFailed = Error: Could not start a new process as administrator.
ErrorNoScriptPath = Error: You must launch this script from a file.
ErrorNoPackageFound = Error: No package or bundle found in the script directory. Please make sure the package or bundle you want to install is placed in the same directory as this script.
ErrorManyPackagesFound = Error: More than one package or bundle found in the script directory. Please make sure only the package or bundle you want to install is placed in the same directory as this script.
ErrorPackageUnsigned = Error: The package or bundle is not digitally signed or its signature is corrupted.
ErrorNoCertificateFound = Error: No certificate found in the script directory. Please make sure the certificate used to sign the package or bundle you are installing is placed in the same directory as this script.
ErrorManyCertificatesFound = Error: More than one certificate found in the script directory. Please make sure only the certificate used to sign the package or bundle you are installing is placed in the same directory as this script.
ErrorBadCertificate = Error: The file "{0}" is not a valid digital certificate. CertUtil returned with error code {1}.
ErrorExpiredCertificate = Error: The developer certificate "{0}" has expired. One possible cause is the system clock isn't set to the correct date and time. If the system settings are correct, contact the app owner to re-create a package or bundle with a valid certificate.
ErrorCertificateMismatch = Error: The certificate does not match the one used to sign the package or bundle.
ErrorCertIsCA = Error: The certificate can't be a certificate authority.
ErrorBannedKeyUsage = Error: The certificate can't have the following key usage: {0}. Key usage must be unspecified or equal to "DigitalSignature".
ErrorBannedEKU = Error: The certificate can't have the following extended key usage: {0}. Only the Code Signing and Lifetime Signing EKUs are allowed.
ErrorNoBasicConstraints = Error: The certificate is missing the basic constraints extension.
ErrorNoCodeSigningEku = Error: The certificate is missing the extended key usage for Code Signing.
ErrorInstallCertificateCancelled = Error: Installation of the certificate was cancelled.
ErrorCertUtilInstallFailed = Error: Could not install the certificate. CertUtil returned with error code {0}.
ErrorGetDeveloperLicenseFailed = Error: Could not acquire a developer license. For more information, see http://go.microsoft.com/fwlink/?LinkID=252740.
ErrorInstallCertificateFailed = Error: Could not install the certificate. Status: {0}. For more information, see http://go.microsoft.com/fwlink/?LinkID=252740.
ErrorAddPackageFailed = Error: Could not install the app.
ErrorAddPackageFailedWithCert = Error: Could not install the app. To ensure security, please consider uninstalling the signing certificate until you can install the app. Instructions for doing so can be found here:\nhttp://go.microsoft.com/fwlink/?LinkId=243053
ANOTHER UPDATE: Ran the sideloading install script as an adiminstrator in PowerShell and now received the following error:
Package could not be registered. (Exception from HRESULT: 0x80073CF6)
Googled it but not many results for Windows 10 developers.
If this is a store/UWP app then it can only be installed via an appx package. Typically this should be via the store.
It is not possible to install a modern/store/UWP app with an MSI.
If you don't want to (or can't) distribute through the store then you can create a package that can be installed directly.
In VS go to: PROJECT > Store > Create App Packages... > And select No to building a package for the store
Before you can install the app on a machine you'll need to enable developer features on that machine:
Settings > Update & Security > For developers > select: Sideload apps
Then just run the PowerShell script created with the package to install it.
Your comment about store submission taking 7 days does not sound correct. Typically submissions will go through in under an hour and only in exceptional circumstances take more than a day.
Store Apps can only be started by the shell as far as I know. So try this:
explorer.exe shell:AppsFolder\Microsoft.WindowsAlarms_8wekyb3d8bbwe!App
Or from run (Win+R):
shell:AppsFolder\Microsoft.WindowsAlarms_8wekyb3d8bbwe!App
Have a look at this article for more details on opening and creating shortcuts: http://winaero.com/blog/exclusive-how-to-start-a-modern-app-from-desktop-without-going-to-the-metro-start-screen/
This is probably a Metro app, which aren't supposed to be deployed using a Setup, but rather using the Store.