1. Start Visual Studio, and create a new project.
2. In the New Project dialog box:
a. From the list of installed templates, expand Visual C#, and select CRM SDK Templates > Unified Service Desk > USD Custom Hosted Control.
b. Ensure that .NET Framework 4.5.2 is selected.
c. Specify the name and location of the project, and click OK to create a new project.
3.In Solution Explorer, double-click the USDControl.xaml file to bring up the XAML designer.
4.In the designer, add the following controls from the Toolbox:
a. Label: In the Properties pane, set the name of the control to “myLabel.”
b. Button: In the Properties pane, set the name of the control to “myButton,” and the content to “Start Debugger.”
5.This is how the controls look in the XAML designer<a href="http://goo.gl/maoapk">.</a>
6.Double-click the button to add code behind the XAML. This will take you to the click event definition of myButton in the USDControl.xaml.cs file. Add the following command.
7.Define a custom action for the hosted control. In the USDControl.xaml.cs file, browse to the override definition of DoAction.
8.Add the following code within the override definition of DoAction to define a custom action called MyCustomAction, which accepts a parameter called username.
9.Save your project, and build it (Build > Build Solution) to verify that it builds successfully.