Save the key file password in Visual Studio

When you have already set up the project signing of the C# application for ClickOnce deployment, and move the solution to another workstation you may get the following error message when you build the solution: Severity Code Description Project File Line Suppression State Error Cannot import the following key file: …..pfx. The key file may …

No Entity Framework provider found for the ADO.NET provider with invariant name ‘System.Data.SqlClient’

When one of the projects in your solution is referencing the Entity Framework to access a database the Entity Framework NuGet package is added to that project. In the Visual Studio IDE your application may work fine, but when you deploy it to the test or production server the following error message may appear: Exception …

There is already an open DataReader associated with this Command which must be closed first

When your MVC 5 web application page tries to read the database using the Entity Framework in a loop you may get the following error message: InnerException: System.InvalidOperationException HResult=-2146233079 Message=There is already an open DataReader associated with this Command which must be closed first. Source=System.Data This usually happens when a cshtml page receives an IEnumerable<> …

How to add tooltip to a Windows Form

In Windows Form applications the tooltip functionality is not built into the controls as in HTML objects. To add tooltip to your controls on Windows Forms Open the Windows Form in the designer Drag the ToolTip control from the Common Controls section of the Toolbox to the form. The ToolTip control will be placed at …

How to handle “The target version of the .NET Framework in the project does not match…” warning message in Microsoft Visual Studio

When you build the setup project in Microsoft Visual Studio 2010 you receive the following warning message: The target version of the .NET Framework in the project does not match the .NET Framework launch condition version ‘.NET Framework 4 Client Profile’. Update the version of the .NET Framework launch condition to match the target version …

How to solve “The version of the .NET Framework launch condition ‘.NET Framework 4’ does not match…” warning in Microsoft Visual Studio

When you build the setup project in Microsoft Visual Studio 2010 you receive the following warning message: The version of the .NET Framework launch condition ‘.NET Framework 4’ does not match the selected .NET Framework bootstrapper package. Update the .NET Framework launch condition to match the version of the .NET Framework selected in the Prerequisites …

Solving “The type or namespace name … could not be found” error in Microsoft Visual Studio

When you compile a .NET 4.0 C# application the following error message appears: The type or namespace name … could not be found (are you missing a using directive or an assembly reference?) There is also a warning message : The currently targeted framework “.NET Framework,Version=v4.0,Profile=Client” does not include “System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” which the …