Sysprep quick fix

| |

Sometime, sysprep operation may fail with the following error message:System Preparation Tool 3.14 A fatal error occurred while trying to sysprep the machine

Details can be found on Microsoft web site 

The quick fix is available here

In run as administrator PowerShell

Import-Module Appx
Import-Module Dism

Get-AppxPackage -AllUser | Format-List PackageFullName

Copy the result in new text file.

in the result, replace "PackageFullName:" with "Remove-AppxPackage -Package"

Copy the edited rows and paste in power shell window

check is there any apps left

2016/08/09 19:43

Deploy ASP .NET MVC application using LocalDB to local IIS

| |

When ASP application is published to IIS using LocalDB accessing the database may result in the following error:


Server Error in '/Application_Name' Application.

2016/08/08 22:06

C# Custom control – TextBox accepting only numbers, decimal numbers, signed numbers

| | | | |

The creation of custom control using Visual Studio involves the following steps:

  1. Start Visual Studio;
  2. Create new “Windows Control Library” project;
  3. In the created project delete “User Control” file;
  4. Go to “Project” > “Add User Control” and give it a name;

    2016/07/29 21:38

Visual Studio – Add custom control DLL to toolbox

| |

To add a custom control to VisualStudio project:

1) Go to “Toolbox” tab;
2) Right click on it and click “Choose Items…”;

3) In the “Choose Toolbox Items” window click on the “Browse…” button.
Navigate to the location where your Dynamic Link Library (DLL) file is.
Click “OK”.

2016/07/28 21:17

C# - How to add reference to project

| |

To add a reference to CSharp project do the following:

1) Open “Solution Explorer”;
2) Right click “References”;
3) Choose “Add Reference”.

On the Reference Manager Window go to: “Assemblies” -> “Framework”. In the list find the reference you need, select it and checkup the checkbox in front it. Then select “OK”.

2016/07/27 18:23

C# Textbox - enter only positive numbers on KeyPress event in Windows form application

| | |

To prevent users from entering incorrect data in Windows form application, set restriction to allow only specific characters to be entered in the text box.

This example uses KeyPress event to monitor the users input and to apply the restriction required.

2016/07/22 18:16