Command line support for .Net services and ASP.Net

By Stephen Kellett
29 September, 2011

Today we have released updated versions of our software tools for .Net, .Net Coverage Validator, .Net Memory Validator and .Net Performance Validator.

The updates to each tool add support for monitoring .Net services and ASP.Net processes when working with the tool from the command line. This allows you to, for example, control the tool from batch files and easy create large suites of tests that you can run and control from batch files or using other scripting technologies. This command line support builds on the already existing command line support in each tool for working with .Net desktop appplications. For information on existing command line options for each tool please see the help file that ships with each tool.

I’m going to outline the new command line options for each tool and provide some basic examples of how you might use these options with each tool. Each tool has been given the same basic options, with each tool getting some additional options specific to that tool.

.Net Coverage Validator

  • -serviceName fileNameThe -serviceName option is used to specify which service .Net Coverage Validator should monitor. The filename argument should be quoted if the filename contains spaces.
    -serviceName c:\path\myservice.exe
    -serviceName "c:\path with spaces\myservice.exe"
    
  • -urlToVisit urlThe -urlToVisit option specifies the web page that should be opened by the web browser when working with ASP.Net web servers.
    -urlToVisit http://localhost/myTestPage.aspx
    -urlToVisit "http://localhost/myTestPage.aspx"
    
  • -aspNetName filenameThe -aspNetName option is used to specify the ASP.Net process that is used by IIS. The filename argument should be quoted if the filename contains spaces.
    -aspNetName c:\windows\Microsoft.Net\Framework\v4.0.30319\aspnet_wp.exe
    -aspNetName "c:\windows\Microsoft.Net\Framework\v4.0.30319\aspnet_wp.exe"
    

    The value specified should be the value that you would specify if you used the .Net Coverage Validator interface to work with ASP.Net applications.

  • -webRoot directorynameThe -webRoot option is used to specify the web root for this ASP.Net process. The directoryname argument should be quoted if the filename contains spaces.
    -webRoot c:\inetpub\wwwroot
    -webRoot "c:\inetpub\wwwroot"
    
  • -webBrowser filenameThe -webBrowser option is used to specify which web browser to use to open the web page if the user has chosen to specify a particular web browser. This option is used when the -aspNetWeb option specifies to use a specific web browser. The filename argument should be quoted if the filename contains spaces.
    -webBrowser c:\mozilla\firefox.exe
    -webBrowser "c:\program files\internet explorer\iexplore.exe"
    
  • -coverageDirectory directorynameThe -coverageDirectory option specifies the directory .Net Coverage Validator will use to communicate with the GUI if security privileges do not allow named pipes and shared memory usage. The directoryname argument should be quoted if the filename contains spaces.
    -coverageDirectory c:\temp
    
  • -aspNetWeb default|user|specificThe -aspNetWeb option is used to specify which web browser will be used to open the web page you have specified.The options are:
    defaultUse the default web browser.
    userThe user will open a web browser themselves.
    specificUse a web browser identified by a filepath. Use in conjunction with -webBrowser option.
    -aspNetWeb default
    -aspNetWeb user
    -aspNetWeb specfic
    
  • -aspNetDelay integerThe -aspNetDelay option is used to specify how long .Net Coverage Validator will wait for IIS to reset and restart itself. The delay is specified in milliseconds.
    -aspNetDelay 5000
    

Working with .Net services

This example shows how to use .Net Coverage Validator with a .Net service.

dnCoverageValidator.exe -serviceName E:\WindowsService\bin\Debug\WindowsService.exe 
                        -coverageDirectory c:\test\coverage 
                        -saveSession "c:\test results\testbed.dncvm" 
                        -hideUI
  • -serviceName E:\WindowsService\bin\Debug\WindowsService.exeThis specifies the service to monitor. The service must be started after .Net Coverage Validator has been instructed to monitor the service.
  • -coverageDirectory c:\test\coverageThis specifies the directory .Net Coverage Validator will use to communicate with the GUI if security privileges do not allow named pipes and shared memory usage.
  • -saveSession “c:\test results\testbed.dncvm”This specifies that after the application finishes the session should be saved in the file c:\test results\testbed.dncvm.
  • -hideUIThis specifies that the user interface should not be displayed during the test. When the target service closes .Net Coverage Validator will close.

Working with ASP.Net

This example shows how to use .Net Coverage Validator with ASP.Net.

dnCoverageValidator.exe -urlToVisit http://localhost/testWebApp.aspx 
                        -aspNetName c:\windows\Microsoft.Net\Framework\v4.0.30319\aspnet_wp.exe 
                        -aspNetWeb default -aspNetDelay 5000 -webRoot c:\inetput\wwwroot 
                        -coverageDirectory c:\test\coverage 
                        -saveSession "c:\test results\testbed.dncvm" 
                        -hideUI
  • -urlToVisit http://localhost/testWebApp.aspxThis specifies the web page that will be opened when working with ASP.Net
  • -aspNetName c:\windows\Microsoft.Net\Framework\v4.0.30319\aspnet_wp.exeThis specifies the ASP.Net worker process that IIS will start.
  • -aspNetWeb defaultThis specifies that the system defined web browser will be used to open the web page.
  • -aspNetDelay 5000This specifies a delay of 5 seconds to allow the IIS webserver to restart.
  • -webRoot c:\inetput\wwwrootThis specifies the web root of the IIS web server.
  • -coverageDirectory c:\test\coverageThis specifies the directory .Net Coverage Validator will use to communicate with the GUI if security privileges do not allow named pipes and shared memory usage.
  • -saveSession “c:\test results\testbed.dncvm”This specifies that after the application finishes the session should be saved in the file c:\test results\testbed.dncvm.
  • -hideUIThis specifies that the user interface should not be displayed during the test. When the target service closes .Net Coverage Validator will close.

.Net Memory Validator

  • -collectDataThe -collectData option causes .Net Memory Validator to collect memory allocation events until the user chooses to disable data collection from the user interface.
    -collectData
    
  • -doNotCollectDataThe -doNotCollectData option causes .Net Memory Validator to ignore memory allocation events until the user chooses to enable data collection from the user interface.
    -doNotCollectData
    
  • -serviceName fileNameThe -serviceName option is used to specify which service .Net Memory Validator should monitor. The filename argument should be quoted if the filename contains spaces.
    -serviceName c:\path\myservice.exe
    -serviceName "c:\path with spaces\myservice.exe"
    
  • -urlToVisit urlThe -urlToVisit option specifies the web page that should be opened by the web browser when working with ASP.Net web servers.
    -urlToVisit http://localhost/myTestPage.aspx
    -urlToVisit "http://localhost/myTestPage.aspx"
    
  • -aspNetName filenameThe -aspNetName option is used to specify the ASP.Net process that is used by IIS. The filename argument should be quoted if the filename contains spaces.
    -aspNetName c:\windows\Microsoft.Net\Framework\v4.0.30319\aspnet_wp.exe
    -aspNetName "c:\windows\Microsoft.Net\Framework\v4.0.30319\aspnet_wp.exe"
    

    The value specified should be the value that you would specify if you used the .Net Memory Validator interface to work with ASP.Net applications.

  • -webRoot directorynameThe -webRoot option is used to specify the web root for this ASP.Net process. The directoryname argument should be quoted if the filename contains spaces.
    -webRoot c:\inetpub\wwwroot
    -webRoot "c:\inetpub\wwwroot"
    
  • -webBrowser filenameThe -webBrowser option is used to specify which web browser to use to open the web page if the user has chosen to specify a particular web browser. This option is used when the -aspNetWeb option specifies to use a specific web browser. The filename argument should be quoted if the filename contains spaces.
    -webBrowser c:\mozilla\firefox.exe
    -webBrowser "c:\program files\internet explorer\iexplore.exe"
    
  • -aspNetWeb default|user|specificThe -aspNetWeb option is used to specify which web browser will be used to open the web page you have specified.The options are:
    defaultUse the default web browser.
    userThe user will open a web browser themselves.
    specificUse a web browser identified by a filepath. Use in conjunction with -webBrowser option.
    -aspNetWeb default
    -aspNetWeb user
    -aspNetWeb specfic
    
  • -aspNetDelay integerThe -aspNetDelay option is used to specify how long .Net Memory Validator will wait for IIS to reset and restart itself. The delay is specified in milliseconds.
    -aspNetDelay 5000
    

Working with .Net services

This example shows how to use .Net Memory Validator with a .Net service.

dnMemoryValidator.exe -serviceName E:\WindowsService\bin\Debug\WindowsService.exe 
                      -saveSession "c:\test results\testbed.dnmvm" -hideUI
  • -serviceName E:\WindowsService\bin\Debug\WindowsService.exeThis specifies the service to monitor. The service must be started after .Net Memory Validator has been instructed to monitor the service.
  • -saveSession “c:\test results\testbed.dnmvm”This specifies that after the application finishes the session should be saved in the file c:\test results\testbed.dnmvm.
  • -hideUIThis specifies that the user interface should not be displayed during the test. When the target service closes .Net Memory Validator will close.

Working with ASP.Net

This example shows how to use .Net Memory Validator with ASP.Net.

dnMemoryValidator.exe -urlToVisit http://localhost/testWebApp.aspx 
                      -aspNetName c:\windows\Microsoft.Net\Framework\v4.0.30319\aspnet_wp.exe 
                      -aspNetWeb default -aspNetDelay 5000 -webRoot c:\inetput\wwwroot 
                      -saveSession "c:\test results\testbed.dnmvm" -hideUI
  • -urlToVisit http://localhost/testWebApp.aspxThis specifies the web page that will be opened when working with ASP.Net
  • -aspNetName c:\windows\Microsoft.Net\Framework\v4.0.30319\aspnet_wp.exeThis specifies the ASP.Net worker process that IIS will start.
  • -aspNetWeb defaultThis specifies that the system defined web browser will be used to open the web page.
  • -aspNetDelay 5000This specifies a delay of 5 seconds to allow the IIS webserver to restart.
  • -webRoot c:\inetput\wwwrootThis specifies the web root of the IIS web server.
  • -saveSession “c:\test results\testbed.dnmvm”This specifies that after the application finishes the session should be saved in the file c:\test results\testbed.dnmvm.
  • -hideUIThis specifies that the user interface should not be displayed during the test. When the target service closes .Net Memory Validator will close.

.Net Performance Validator

  • -collectDataThe -collectData option causes .Net Performance Validator to collect memory allocation events until the user chooses to disable data collection from the user interface.
    -collectData
    
  • -doNotCollectDataThe -doNotCollectData option causes .Net Performance Validator to ignore memory allocation events until the user chooses to enable data collection from the user interface.
    -doNotCollectData
    
  • -collectFunctionTimesThe -collectFunctionTimes option causes .Net Performance Validator to collect timing information for functions in the application/service/ASP.Net webserver.
    -collectFunctionTimes
    
  • -collectLineTimes
    The -collectLinesTimes option causes .Net Performance Validator to collect timing information for lines in the application/service/ASP.Net webserver.

    -collectLineTimes
    
  • -doNotCollectFunctionTimes
    The -doNotCollectFunctionTimes option causes .Net Performance Validator not to collect timing information for functions in the application/service/ASP.Net webserver.

    -doNotCollectFunctionTimes
    
  • -doNotCollectLineTimes
    The -doNotCollectLinesTimes option causes .Net Performance Validator not to collect timing information for lines in the application/service/ASP.Net webserver.

    -doNotCollectLineTimes
    
  • -serviceName fileNameThe -serviceName option is used to specify which service .Net Performance Validator should monitor. The filename argument should be quoted if the filename contains spaces.
    -serviceName c:\path\myservice.exe
    -serviceName "c:\path with spaces\myservice.exe"
    
  • -urlToVisit urlThe -urlToVisit option specifies the web page that should be opened by the web browser when working with ASP.Net web servers.
    -urlToVisit http://localhost/myTestPage.aspx
    -urlToVisit "http://localhost/myTestPage.aspx"
    
  • -aspNetName filenameThe -aspNetName option is used to specify the ASP.Net process that is used by IIS. The filename argument should be quoted if the filename contains spaces.
    -aspNetName c:\windows\Microsoft.Net\Framework\v4.0.30319\aspnet_wp.exe
    -aspNetName "c:\windows\Microsoft.Net\Framework\v4.0.30319\aspnet_wp.exe"
    

    The value specified should be the value that you would specify if you used the .Net Performance Validator interface to work with ASP.Net applications.

  • -webRoot directorynameThe -webRoot option is used to specify the web root for this ASP.Net process. The directoryname argument should be quoted if the filename contains spaces.
    -webRoot c:\inetpub\wwwroot
    -webRoot "c:\inetpub\wwwroot"
    
  • -webBrowser filenameThe -webBrowser option is used to specify which web browser to use to open the web page if the user has chosen to specify a particular web browser. This option is used when the -aspNetWeb option specifies to use a specific web browser. The filename argument should be quoted if the filename contains spaces.
    -webBrowser c:\mozilla\firefox.exe
    -webBrowser "c:\program files\internet explorer\iexplore.exe"
    
  • -profilerDirectory directorynameThe -profilerDirectory option specifies the directory .Net Performance Validator will use to communicate with the GUI if security privileges do not allow named pipes and shared memory usage. The directoryname argument should be quoted if the filename contains spaces.
    -profilerDirectory c:\temp
    
  • -aspNetWeb default|user|specificThe -aspNetWeb option is used to specify which web browser will be used to open the web page you have specified.The options are:
    defaultUse the default web browser.
    userThe user will open a web browser themselves.
    specificUse a web browser identified by a filepath. Use in conjunction with -webBrowser option.
    -aspNetWeb default
    -aspNetWeb user
    -aspNetWeb specfic
    
  • -aspNetDelay integerThe -aspNetDelay option is used to specify how long .Net Performance Validator will wait for IIS to reset and restart itself. The delay is specified in milliseconds.
    -aspNetDelay 5000
    

Working with .Net services

This example shows how to use .Net Performance Validator with a .Net service.

dnPerformanceValidator.exe -serviceName E:\WindowsService\bin\Debug\WindowsService.exe 
                          -profilerDirectory c:\test\profiler 
                          -saveSession "c:\test results\testbed.dnpvm" 
                          -hideUI
  • -serviceName E:\WindowsService\bin\Debug\WindowsService.exeThis specifies the service to monitor. The service must be started after .Net Performance Validator has been instructed to monitor the service.
  • -profilerDirectory c:\test\profilerThis specifies the directory .Net Performance Validator will use to communicate with the GUI if security privileges do not allow named pipes and shared memory usage.
  • -saveSession “c:\test results\testbed.dnpvm”This specifies that after the application finishes the session should be saved in the file c:\test results\testbed.dnpvm.
  • -hideUIThis specifies that the user interface should not be displayed during the test. When the target service closes .Net Performance Validator will close.

Working with ASP.Net

This example shows how to use .Net Performance Validator with ASP.Net.

dnPerformanceValidator.exe -urlToVisit http://localhost/testWebApp.aspx 
                           -aspNetName c:\windows\Microsoft.Net\Framework\v4.0.30319\aspnet_wp.exe 
                           -aspNetWeb default -aspNetDelay 5000 -webRoot c:\inetput\wwwroot 
                           -profilerDirectory c:\test\profiler 
                           -saveSession "c:\test results\testbed.dnpvm" 
                           -hideUI
  • -urlToVisit http://localhost/testWebApp.aspxThis specifies the web page that will be opened when working with ASP.Net
  • -aspNetName c:\windows\Microsoft.Net\Framework\v4.0.30319\aspnet_wp.exeThis specifies the ASP.Net worker process that IIS will start.
  • -aspNetWeb defaultThis specifies that the system defined web browser will be used to open the web page.
  • -aspNetDelay 5000This specifies a delay of 5 seconds to allow the IIS webserver to restart.
  • -webRoot c:\inetput\wwwrootThis specifies the web root of the IIS web server.
  • -profilerDirectory c:\test\profilerThis specifies the directory .Net Performance Validator will use to communicate with the GUI if security privileges do not allow named pipes and shared memory usage.
  • -saveSession “c:\test results\testbed.dnpvm”This specifies that after the application finishes the session should be saved in the file c:\test results\testbed.dnpvm.
  • -hideUIThis specifies that the user interface should not be displayed during the test. When the target service closes .Net Performance Validator will close.

Fully functional, free for 30 days