In this walkthrough I will perform load testing for WCF service using VS 2012 ultimate version using test environment that consists of one controller and three agent machines, what we will cover in this walkthrough could be summarized into the following:
First we will start by downloading the VS test agent and controller update 4 installers located at
http://www.microsoft.com/en-us/download/confirmation.aspx?id=38186
The installer consists of two folders and two installer files vstf_testagent.exe and vstf_testcontroller.exe
First we will begin by Installing and configuring the controller, make sure VS 2012 is installed and running on controller machine, also SQL is needed to store performance data
After finishing the installation lunch the test controler configuration tool
Here you have to specify which account to be used with test controller service and load testing database server that will store performance data.
Now Installing Agent on Agent machines, in our environment we will install it into three machines joined to same controller machine domain.
Next configure the Agents to connect to controller, in WCF scenario we need to run in as a service as no interaction is needed in load test.
Then configure the test agent by specifying the account name and the test controller we have created previously , make sure the port 6901 is set in test controller name
Now after configuring the test Agents and controller we could create load test project using VS 2012 IDE, Create Web performance and Load test project from Test category in new project menu in VS 2012 IDE
From Load test manage test controllers to make sure all agents are connected and in ready state
list of agents getting displayed with status for each agent
To distribute the tests on agents we have to create test settings for load test project to enable remote execution on agents (running tests on Agents instead of controller only (local execution)),this could be accomplished by adding new item to project and choose test setting
Choose remote execution for test execution method
In test settings wizard you could specify the host where test will run
You could change the test time out as well
Now we will install the Load Tests add-on for VS for WCF, you could download it from URL:
http://wcfloadtest.codeplex.com/
After downloading and installing the add-on you could add new item with WCF test template that will start new WCF test generation wizard that will guide you to log the WCF call and save it as unit test
First you have to include the executable that calls the web service , in our case we developed a WPF application that calls the service
After calling the service from the executable the SOAP call is recorded as shown below
After the wizard is complete two CS files is added to your project
in next post we will proceed with configuring the WCF unit test and the remaining steps to perform the load test
Figure 1: Windows Initiated Processing Scenario
Figure 2: TI Assembly in VS 2012
Figure 3: TI Library Properties
Figure 4: Select Assembly from GAC form
1- Create the TI Assembly as you need and configure the calling model of the assembly to be “DirectCall, WCF, WS, BAHA”
2- Now in the same properties make sure you have set the Debug property to “True”
3- Now save the TI assembly and you will find the following are the generated artifacts in the output folder:
4- Now take notice of the generated CS file marked above. Now create a new class library project and name it as you see fit. In that Class library project make sure that the .NET version is set to 4.0 at least (as HIS 2013 is upgraded to .Net 4.0) and then add the generated CS file to that project ( you might even add it as a link to make sure if the CS file is re-generated it is automatically updated in the class library project)
5- Now make sure you add the following line to the AssemblyInfo.cs[assembly: System.CLSCompliant(true)]
6- Now go to the properties of the class library and make this library a signed library as you do with any C# library
7- Add references to the following assemblies:C:\Program Files\Microsoft Host Integration Server 2013\system\Microsoft.HostIntegration.TI.ClientContext.dllC:\Program Files\Microsoft Host Integration Server 2013\system\Microsoft.HostIntegration.TI.TBGen.dllC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.ServiceModel.dllC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.Services.dll
8- Now build the assembly it should build successfully and then add it to the GAC using Gacutil.exe as you would do with any other assembly. The TI assembly is now GACed and ready to be used.
1- Since the TI assembly is a .Net 4.0 assembly it will be GACed in the .Net 4.0 GAC and hence will require the .Net 4.0 Gacutil to be handled. Which comes installed with VS 2012.
2- Now for some reason the HIS HostApps adapter is not linked correctly to the VS2012 installation folder and hence I had to change things a little to make sure it is able to see the TI assembly in the GAC.
3- Open the Regedit application and browse to the path “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework”
4- Add a new string value with the name “sdkInstallRootv2.0” and set the value of this string to “C:\Gacutil4”
5- Now open the .net 4.0 tools folder “C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools” and copy all the contents of this folder to the folder “C:\Gacutil4\Bin” (just create this folder).
6- Now open the BizTalk administration console.
7- Create a new send port in BizTalk
8- Select the HostApps as the adapter and then click configure and configure the connection string
9- Now click add and then add assemblies (GAC) option
10- Now you will see all assemblies installed in the .Net 4.0 GAC and you can select your TI assembly that you installed in Part 1 above
11- Now complete the configuration as usual and click ok to configure the send port
12- Now if you check the connection string created and compaire the TI GACed assembly with a normal one you will find this as below:
13- Now you can use this send port normally.
1. Test Client Access: first test to make sure that the configuration is working is to test through browser:
a. From the browser open the URL points to your server, in my scenario this is: https://ts.meamcs.com/rdweb
b. You will see all the published programs:
c. For testing open any of the programs, you will get prompted that the website is trying to run a RemoteApp program, as the following snapshot, click Connect.
d. When prompting for credential, enter the user name and password, also notice that the connection is with the new name configured earlier:
e. Now we have Active Directory Module for PowerShell is working and the marked cmdlet from Active Directory Module for PowerShell:
1. From the Start Menu > open Remote Desktop application.
2. Either click on Access RemoteApp and Desktop Connection or from Settings charm click on Manage RemoteApp and desktops.
3. Click Add New Connection, then enter the URL for your server https://URL/rdweb/feed/webfeed.aspx and click Connect.
4. When prompt for credential put the username and password:
5. Now your Surface is connecting to the server running RemoteApp and retrieving all the programs:
6. Click OK after retrieving the list of programs:
7. This is the list of the available programs which now appears also in the start menu:
8. From the list of programs or from the start menu let’s start PowerShell ISE:
9. As you can see we have PowerShell ISE running with Windows Azure AD (Set-MsolUser is Office 365 cmdlet) and with Azure module (Add-AzureAccount is Windows Azure cmdlet).
1. Access a link to the program on a Web site by using TS Web Access.
2. Double-click a Remote Desktop Protocol (.rdp) file that has been created and distributed by their administrator.
3. Double-click a program icon on their desktop or Start menu that has been created and distributed by their administrator with a Windows Installer (.msi) package.
4. Double-click a file where the file name extension is associated with a RemoteApp program. This can be configured by their administrator with a Windows Installer package
1. RD Session Host: Remote Desktop Session Host (RD Session Host), formerly Terminal Server, enables a server to host Windows-based programs or the full Windows desktop. Users can connect to an RD Session Host server to run programs, to save files, and to use network resources on that server.
2. RD Web Access: Remote Desktop Web Access (RD Web Access), formerly TS Web Access, enables users to access RemoteApp and Desktop Connection through the Start menu on a computer that is running Windows 7 or through a Web browser. RemoteApp and Desktop Connection provides a customized view of RemoteApp programs and virtual desktops to users.
When a user starts a RemoteApp program, a Remote Desktop Services session is started on the RD Session Host server that hosts the RemoteApp program.
3. RD Connection Broker [Optional]: The RD Connection Broker database stores session state information that includes session IDs, their associated user names, and the name of the server where each session resides. When a user with an existing session connects to an RD Session Host server in the load-balanced farm, RD Connection Broker redirects the user to the RD Session Host server where their session exists. This prevents the user from being connected to a different server in the farm and starting a new session.
RD Connection Broker is also used to provide users with access to RemoteApp and Desktop Connection.
4. DC: of course a Domain Controller is needed.
5. Trusted Certificate [Optional]: if you don’t want to get a warning on the certificate you will need to get a commercial certificate. Otherwise you can use an internal generated certificate and configure your Surface to trust the Root/Issuing CA.
6. DNS Record: you will need DNS record Points to your server.
1. Install the required roles: I will use Windows 2012 so on the dedicated machine:
a. Click Add Roles> Select Remote Desktop Services Installation:
b. Then select Standard deployment:
c. Select Session-based desktop Deployment:
d. Under Role services the wizard will install the three roles: RDSH, RDWA and RDCB, as the following snapshot:
e. Click Next.
f. Only if you get the following error continue with the following steps, if you didn’t get error then skip to step i. Error:
“Unable to connect to the server by using Windows PowerShell remoting”
g. Start PoerShell as Administrator, and run the following cmdlet:
Enable-PSRemoting -forceSet-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1000
h. The following snapshot shows the cmdlets:
i. In RD Connection Broker: select the server name as the following snapshot:
j. Do the same by adding the selected server in the RD WA and RD SH.
k. On the confirmation page click to restart the server after the installation and click Deploy to start the installation.
1. Follow the following steps to create a Session Collection:
a. From the Server Manager, click Remote Desktop Services on the left side.
b. Click Collections> click Tasks, and then click Create Session Collection. Check the following snapshot:
c. On the Before You Begin page of the Create Collection wizard, click Next.
d. On the Name the collection page, type SessionCollection in the Name box, and then click Next, as the following snapshot:
e. On the Specify RD Session Host servers page, select the server name, click the right arrow, and then click Next.
f. On the Specify user groups page, accept the default selections (Domain Users), and then click Next.
g. On the Specify user profile disks page, clear the Enable user profile disks check box, and then click Next.
h. On the Confirm selections page, click Create.
2. Configure Remote Desktop Web Access Parameters: Change the URL the users will use to connect to: in Windows 2008 R2 that was very easy, however in Windows 2012 this can’t be changed. From the server manager click Edit Deployment Properties, check the following snapshot:
a. When you open the properties, the RD Web Access can’t be edited:
b. To change the name where the users will be connected to, we will need to get this PowerShell script: http://gallery.technet.microsoft.com/Change-published-FQDN-for-2a029b80, and use the cmdlet Set-RDPublishedName ts.meamcs.com
3. Allow Required Ports: Configure the Endpoints on Azure to allow access for HTTPS (443) and RDP (3389), from the Virtual Machine > click Endpoints.
a. Create new rule for HTTPS, and modify the existing port for the Remote Desktop, as the following snapshot:
b. The following snapshot shows the final settings for the endpoints:
c. Don’t forget to change your RDP connection to use now 3389 other than the random port you used to connect through it before.
4. Configure the Commercial Certificate: to avoid getting warning on the HTTPs that the certificate is not trusted, we will need a certificate issued from commercial CA (or get internal generated certificate and configure your devices including Surface to trust the Root CA), in this scenario we will use publicly issued certificate:
a. Import the certificate to IIS: open IIS, under server name select Server Certificates:
b. Import the certificate.
c. Configure Binding with the new certificate: click on the default website, from the Actions pane in the left select Bindings:
5. Configure Remote Desktop to use the commercial certificate, so you don’t get any warning from RemoteApp (RDP connection) that the server is not trusted (default installation will use self-signed certificate):
a. Open Server Manager.
b. Browse to Remote Deployment Services.
c. Click Edit Deployment Properties.
d. Under Certificates browse to the PFX file of your commercial certificate as the following snapshot:
6. Install programs on the RDSH server: To ensure that an application is installed correctly to work in a multiuser environment, you must put the RD Session Host server into a special installation mode before you install the application on the RD Session Host server. This special installation mode ensures that the correct registry entries and .ini files that are needed to support running the application in a multiuser environment are created during the installation process.
To put an RD Session Host server into this special installation mode:
a. Open Control Panel > open Install Application on Remote Desktop Server
b. Click Next on Install Program from Floppy disk or CD-ROM. (didn’t know that there are still programs on the floppy disks J, reminded me of the golden days when we had Windows 3.11 on 9 floppy disks)
c. Browse to the application that you want to install, in this scenario I’m installing Project Pro.
d. Click next to install the program.
e. Repeat these steps for all the programs that you want to install on your server.
7. Publish RemoteApp Programs:
a. Open Server Manager > On the left side of the window, click Remote Desktop Services.
b. Under Collections, click SessionCollection.
c. In the REMOTEAPP PROGRAMS tile, click Tasks, and then click Publish RemoteApp Programs.
d. On the Select RemoteApp Programs page, select the programs that you want to add to the RemoteAPP, in my scenario this will be (Project, Visio, PowerShell ISE, PowerShell module for AD and Azure, Windows Live Writer), check the following snapshot:
e. On the Confirmation page, click Publish.
f. When the RemoteApp program is published, click Close.
8. Configure the File type Association:
c. Under the REMOTEAPP PROGAMS heading, right-click each program, and then click Edit Properties.
d. Click File Type Association.
e. Select the required extensions as the following snapshot:
f. Click OK.
g. Repeat the steps for all programs.