Posts

VS 2019 is the last version of visual studio with load tests feature and coded UI tests feature

Image
Why Microsoft, why you do that, this is a beautiful piece of a tool that you are putting to waste. according to this . just open source it please, i mean look how good .NET Core is (in my own opinion)

S/MIME Certificate and GMail

So i was asked to have x.509 certificate for a client e-mail. that client happen to use Gmail, which do have a document on how to install that if you are using Gsuite. the problem is it's only enterprise version!, why for a simple feature like that i have to go enterprise level. i would say even free Gmail users should have the ability to use their own S/MIME Personal X.509 certificates to sign and encrypt e-mails.

AES Encryption Decryption .NET Core 2

So if you saw my earlier post about this the code there didn't work for me. but who know me knows i don't give up that easily, there might be a NuGet here or there that do this but i needed to know how this is done! so after 3 hours of digging code on the internet and trying the code for a dozen of times, below is the code which did work for me. i know that the IV should be dynamic in order to further protect this more and this is something i will work on. public static class Crypto { public static string EncryptString(string text, string keyString) { var key = Encoding.UTF8.GetBytes(keyString); var textToChiper = Encoding.UTF8.GetBytes(text); using (var aesAlg = Aes.Create()) { aesAlg.Padding = PaddingMode.PKCS7; aesAlg.Mode = CipherMode.CBC; aesAlg.KeySize = (key.Length * 8); aesAlg.IV = new byte[16]; aesAlg.Key = key; ...

Let's use a publish profile on that Azure Pipeline on TFS !

So we have TFS at work and i have been planning to create a build for a vendor web app which we used the DI the vendor implemented to inject our own custom modules/apps. i managed previously to create a customized publish profile to produce a web package that contain both the vendor DLLs and our own. <!--Cutome entry to include custom DLLs--> <target name="CollectHelpers"> <itemgroup> <_customfiles include="$(MSBuildProjectDirectory)\bin\Custom*.dll"> <filesforpackagingfromproject include="%(_CustomFiles.Identity)"> <destinationrelativepath>bin\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath> </filesforpackagingfromproject> </_customfiles> </target> <target name="CollectCustomizations"> <itemgroup> <_customfiles include="$(MSBuildProjectDirectory)\bin\*Custom*.dll"> <filesforpackagingfrom...

VSTS, VSO and Azure Devops

So i had the chance to explore Azure Devops and i must say i am impressed. i didn't test how much useful it's if we try hook it up to other hosts than Azure but for Azure i must say this is wonderfully working well with some minimum configuration required from my side. the only issue i did encounter while i was trying to setup a build pipeline for my app (.NET Core SDK v2.2.103) was the fact that for some reason this didn't work. digging deeper i found a slimier issue , instead of waiting for the solution i decided to lower the version to SDK 2.2.102 and it worked. now once i push or merge to master branch my solution get build and deployed to my Azure web app. all with minimal configuration from my side. Azure Devops in my opinion is the result of mixing Github and TFS and it do contian the best of both worlds.

SSL Certificates

Today i had hard time installing SSL certificate on one of our IIS servers. when i was trying to follow the provider instructions and "Complete Certificate Request" i got "Failed to remove certificate"! and import required pfx file which i didn't have, we only got crt file. and trying converting that to pfx was failing. until i hit this gem "OR it could be the cert (Network solutions is notorious for this as they charge $150 for helping to install it) doesn't actually have a privatge key.  Here are instructions to make the PFX if you have no private key. To fix this, use the MMC snapin to import the cert into PERSONAL, click it and grab the serial # line.  Go to dos, run certutil -repairstore my "paste the serial 3 in here" (you need the quotes) then refresh MMC with personal certs, right click it – export – select everything except DELETE PRIVATE KEY, hit ok.  Then go to IIS and IMPORT cert instead of finish request.  bingo – fix...

Why .NET Core Whhhhhyyyyy!

So all what i wanted is to encrypt and decrypt a string from on end to another using .NET Core 2 like why this is so hard why complicating something that was as easy as having the same machine key! what if i like to have my own JWT token generation API end point for any reason and guess what instead of sending the user password in the JSON body in plain text i would like to encrypt that based on a shared key that both client and server have it. should be easy, right?! the defult thing you will see when you Google .NET Core 2 Encryption / Decryption is the new Data Protection and IDataProtector interface. you will find a good example on how to use it. public void RunSample() { Console.Write("Enter input: "); string input = Console.ReadLine(); // protect the payload string protectedPayload = _protector.Protect(input); Console.WriteLine($"Protect returned: {protectedPayload}"); ...