Testing an MVC Web Application

This topic applies to presentation projects that implement an MVC Web application. Refer to Creating an MVC Web Application.

Procedure 1 - Testing Under the Debugger

  1. In Solution Explorer, right-click the presentation project, and select Set as StartUp Project.

  2. On the Debug menu, click Start Debugging. Visual Studio automatically starts a copy of IIS Express to host your application and opens your default browser.

  3. If necessary, change the URL in the browser to the form http://localhost:<port>/<controllername>, where <port> is the port number used by IIS express and <controllername> matches the name you specified when you scaffolded the application; the controller name is not case sensitive. Refer to Scaffold Unisys Controller for ePortal Data Source with Views Dialog or Scaffold Unisys Controller for ePortal Data Source Dialog.

If you encounter unexpected errors during your testing, refer to the Troubleshooting section of this help file.

Procedure 2 - Stopping the Debugger

  1. In the Debug menu, click Stop Debugging.

  2. In the Windows system tray (at the right end of your Taskbar), right-click the icon for IIS Express and click Exit. If there are multiple copies of IIS Express running, ensure that you stop each one.

Testing on a Mobile Device

An MVC Web application is designed to be responsive; the application is designed to adapt to a variety of different device sizes. Therefore, you may wish to test you MVC Web application from the browser on a mobile device.

In addition, if you used the ePortal Single Page Application architecture for your MVC Web application, then you can access the MVC application from a Multi-Device Hybrid App.

For more information on the single page application architecture and Multi-Device Hybrid App, refer to the following:

You cannot use IIS Express to test your MVC application from a system other than your development system. Instead, you must publish to Microsoft Internet Information Services (IIS) running on your development machine. Refer to Publishing to IIS.

After publishing to IIS, you can test on a mobile device as follows:

  1. Determine the public IP address for your development system.

    You can do this by running the ipconfig command in a command prompt on your development system.

  2. If your development system is behind a firewall, you must connect your mobile device to your organization’s LAN.

    You can do this via WiFi, if available at your site.

  3. The URL for your MVC application is of the form http://<dev-IP-address>/<Web-app-name>/<controllername>, where:

    • <dev-IP-address> is the public IP address of your development system

    • <Web-app-name> is the Web application name you specified when publishing to IIS

    • <controllername> is the name of the controller you specified when you scaffolded your application

  4. If you encounter unexpected errors during your testing, refer to Troubleshooting.