Tagged: windows

The most dangerous constructor in .NET 12

The most dangerous constructor in .NET

You should never instantiate a X509Certificate2 with the “new” keyword if you can avoid it, it is one of the most dangerous constructors in .NET – X509Certificate2, and if you do, you must be aware of these gotchas. Doing this wrong can mean you flood your disk with one-time use files, that are never removed. If you load in a new X509Certificate2 from a file by calling the public X509Certificate2 (string fileName, SecureString password); constructor, or similar constructor then you will without knowing it, create a brand new file on your disk, and this will happen every time you new it up. When you instantiate a X509Certificate2 from disk, say from a .pfx file, a new storage file of 3-4kb will be created in one of the following places depending...

Git does not remember username and password 4

Git does not remember username and password on Windows

Git does not remember username and password…! I was having issues, where Git would not remember my credentials for some repositories on Windows. Usually, the repositories are stored on AzureDevops and use Windows Authentication as default, with PAT (Personal Access Token) as a fallback. In this case, since I am not an employee in the company, I was given a PAT. But git kept asking me to enter credentials for every operation against the repository origin and it was making me crazy that it was not remembering my credentials. Make sure that you are using Windows Credentials manager If you are using Git on Windows, you should store your credentials in the Windows Credentials manager, so they are properly encrypted and protected. You can check this by running the following...