The ObjectInfo helper displays the type and the value of each object you pass to it. You can use it to view the value of variables and objects in your code like you did with output expressions in the previous example , plus you can see data type information about the object.
The type. For the first variable, the type is DayOfWeek. For the second variable, the type is String. The value. In this case, because you already display the value of the greeting variable in the page, the value is displayed again when you pass the variable to ObjectInfo. For more complex objects, the ObjectInfo helper can display more information — basically, it can display the types and values of all of an object's properties. For a more comprehensive debugging experience, use Visual Studio.
With Visual Studio, you can set a breakpoint in your code at the line that you want to inspect. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Introduction to Debugging ASP.
Is this page helpful? Please rate your experience Yes No. Any additional feedback? Note Important You should remove any diagnostic code from your web pages before you move web pages to a production server.
To debug on local IIS, you must meet the following requirements:. If it's not installed, install the ASP. NET and web development workload. Rerun the Visual Studio Installer, select Modify , and add this workload. Make sure it's selected when you add the workload.
NET Core. For ASP. NET Modules. IIS Express is the default, and is preconfigured. Select the ASP. To debug the app, in your project, set breakpoints on some code.
The debugger pauses at the breakpoints. If the debugger can't hit the breakpoints, see Troubleshoot debugging. If not, select Add and add it. NET Core process typically w3wp. NET process. Previous Page. Next Page. Useful Video Courses. More Detail. Real-world App with ASP. Master ASP. NET Core Razor 3. On the computer where you have the ASP. If you have previously configured any publishing profiles, the Publish pane appears. Click New or Create new profile. In the Import Publish Settings File dialog, navigate to and select the profile that you created in the previous section, and click Open.
Click Finish to save the publishing profile, and then click Publish. If you get an any deployment errors, click Edit to edit settings.
Modify settings and click Validate to test new settings. If you get an any deployment errors, click Settings to edit settings. After the app deploys successfully, it should start automatically. Choose Edit to edit the profile, and then choose Settings.
Choose a Debug configuration, and then choose Remove additional files at destination under the File Publish options. In the Settings dialog box, enable debugging by clicking Next , choose a Debug configuration, and then choose Remove additional files at destination under the File Publish options. If you choose a Release configuration, you disable debugging in the web. You can use this option to deploy your app if you want to copy the app to IIS using PowerShell, RoboCopy, or you want to manually copy the files.
NET project. Under Connections , select Application Pools. NET v4. For example, if you are targeting ASP. Click New profile. Click Create profile in the drop-down list Publish is the default value. If you use a Release build, you disable debugging in the web. The application publishes a Debug configuration of the project to the local folder. Progress shows in the Output window. Copy the ASP. In this tutorial, we assume you are copying manually, but you can use other tools like PowerShell, Xcopy, or Robocopy.
If you need to make changes to the code or rebuild, you must republish and repeat this step. The executable you copied to the remote machine must exactly match your local source and symbols. If you do not do this you will receive a cannot find or open the PDB file warning in Visual Studio when you attempt to debug the process. On the Windows Server, verify that you can run the app correctly by opening the app in your browser.
If the app doesn't run correctly, there may be a mismatch between the version of ASP. Recheck earlier steps. On the remote device or server that you want to debug on, rather than the Visual Studio machine, download and install the correct version of the remote tools from the links in the following table. You can run the remote debugger by copying msvsmon. However, the Remote Debugger Configuration Wizard rdbgwiz.
0コメント