Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

How to: Debug or Test a LightSwitch Extension

In order to debug a LightSwitch extension, you must install it in a separate instance of Visual Studio. The Visual Studio 2010 SDK provides an experimental instance of Visual Studio for debugging extensions. You must first enable the experimental instance in order to debug.

You can also test an extension—rather than debug it—by installing it in an instance of LightSwitch. If you make subsequent changes to the extension, you must uninstall and then reinstall the extension in order to test the changes.

To enable an experimental instance

  1. In Solution Explorer, select the MySmartLayoutExtension.Vsix project.

  2. On the menu bar, choose Project, MySmartLayoutExtension.Vsix Properties.

  3. On the Debug tab, under Start Action, choose Start external program.

  4. Enter the path of the Visual Studio executable, devenv.exe.

    By default on a 32-bit system, the path is C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe; on a 64-bit system, it is C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.

  5. In the Command line arguments field, enter /rootsuffix Exp as the command-line argument.

    Note Note

    All subsequent LightSwitch extensibility projects will also use this setting, by default.

To debug an extension

  1. On the menu bar in Visual Studio, choose Debug, Start Debugging. An experimental instance of Visual Studio opens.

  2. In the experimental instance, on the menu bar, choose Add, New Project.

  3. In the New Project dialog box, select the LightSwitch node, and then select LightSwitch Application (Visual Basic) or LightSwitch Application (C#).

  4. In the Name field, enter a name for the test project, and then choose the OK button to create a test project.

    Note Note

    You can also open an existing LightSwitch application.

  5. On the menu bar, choose Project, ProjectName Properties.

  6. In the Project Designer, on the Extensions tab, select the check box next to your extension to enable it for the current project.

  7. Add data and screens as you deem necessary to test the functionality of your extension. You can set breakpoints in the main instance of Visual Studio to debug the extension when the test application is in either design or run mode.

    Tip Tip

    When debugging control extensions that expose properties, you should test the properties in both the design-time and run-time screen designers.

To test an extension without debugging

  1. On the menu bar, choose Build, Build Solution.

  2. Open the output directory of the .Vsix project, and locate the ProjectName.vsix file. The path resembles \ProjectName\ProjectName.Vsix\bin\Debug, under the folder that contains your solution.

  3. Copy the ProjectName.vsix file to a computer where LightSwitch is installed.

    Note Note

    This can be the same computer where you are developing the extension.

  4. On the target computer, double-click the ProjectName.vsix file, and in the Visual Studio Extension Installer dialog box, click Install.

  5. Open a new instance of LightSwitch, and then on the menu bar, choose Add, New Project.

  6. In the New Project dialog box, select the LightSwitch node, and then select LightSwitch Application (Visual Basic) or LightSwitch Application (C#).

  7. In the Name field, enter a name for the test project, and then choose the OK button to create a test project.

    Note Note

    You can also open an existing LightSwitch application.

  8. On the menu bar, choose Project, ProjectName Properties.

  9. In the Project Designer, on the Extensions tab, select the check box next to your extension to enable it for the current project.

    Important note Important

    If you make subsequent changes to the extension, you must uninstall it in Extension Manager and then reinstall the new version of the extension.

  10. Add data and screens as you deem necessary to test the functionality of your extension.

    Tip Tip

    When testing control extensions that expose properties, you should test the properties in both the design-time and run-time screen designers.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft