Skip to main content

Posts

Use of .NET Framework 4 Client Profile

The .NET Framework 4 Client Profile is a subset of the .NET Framework 4 that is created specifically for client applications(including WinForm, WPF, WCF, and ClickOnce). This enables faster deployment experience by having smaller download sizes and quicker install times. An application that targets the .NET Framework 4 Client Profile has a smaller redistribution package that installs the minimum set of client assemblies on the user's computer, without requiring the full version of the .NET Framework 4 to be present. When you deploy an application that targets the .NET Framework 4 Client Profile, you only need to deploy the .NET Framework 4 Client Profile. If you are deploying using ClickOnce, you can select the .NET Framework 4 Client Profile as the .NET Framework Launch Condition.  If you deploy the .NET Framework 4 Client Profile and your application targets the .NET Framework 4, the user will be prompted to install the .NET Framework 4 when he or she tries to run your

Running applications of earlier versions of .Net framework on framework 4.0

The .NET Framework 4 does not automatically use its version of the CLR to run applications that are built with earlier versions. To run older applications with .NET Framework 4, one must compile their application with the target .NET Framework version specified in the properties for your project in VS, or you can specify the supported runtime with the   <supportedRuntime> Element   in an App.Config

Named Parameter feature of C#.Net 4.0

Lets assume, your constructor definition looks like this: public Employee( string firstName, string lastName, DateTime dateOfBirth) In that case, you have no other option in C# 3.0 other than to invoke the constructor like this: Employee employee = new Employee ( "Shweta" , "Jain" , new DateTime(1990, 1, 1)); So, now in this case, it is not clear about what is being assigned in the constructor (e.g., that third DateTime parameter might be date of birth, might be date hired, who knows).   In C# 4.0, you can invoke the constructor like this: Employee employee = new Employee(firstName: "Shweta " , lastName: "Jain" , dateOfBirth: new DateTime(1990, 1, 1)); This expresses the intent clearly and makes the code more understandable. 

Certificate Signing

Signing a message, means authentifying that you have yourself assured the authenticity of the message (most of the time it means you are the author, but not neccesarily). The message can be a text message, or someone else's certificate. To sign a message, you create its hash, and then encrypt the hash with your private key, you then add the encrypted hash and your signed certificate with the message. The recipient will recreate the message hash, decrypts the encrypted hash using your well known public key stored in your signed certificate, check that both hash are equals and finally check the certificate.