Remote Web part debugging

2008. 6. 24. 17:33System/Microsoft SharePoint

http://msdn2.microsoft.com/en-us/library/ms916837.aspx


이 글은 원격 컴퓨터의 웹파트를 디버그하고 개발하는 방법을 소개합니다.

내용은 MSDN의 내용을 발췌하였습니다.


Developing and Debugging from a Remote Computer

To use a remote computer to develop and debug, follow these steps.

Note   To follow these steps, you must have a client computer running Visual Studio .NET (Computer_A) and a server computer running Windows SharePoint Services (Server_B).
  1. On Server_B, share the directory that hosts the SharePoint virtual server. By default, the Windows SharePoint Services virtual server is mapped to the following directory:

    local_drive:\InetPub\wwwroot

  2. Ensure that you have Read and Write permissions for this directory and its sub-directories.
  3. On Server_B, share the directory in which the Microsoft.SharePoint.dll file is located. By default, the Microsoft.SharePoint.dll file is located in the following directory:

    local_drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\ISAPI

  4. Make sure that you have Read permission for this directory.
  5. On Computer_A, follow these steps:
    1. Click Start, point to All Programs, point to Microsoft Visual Studio .NET, and then click Microsoft Visual Studio .NET.
    2. On the File menu in Visual Studio .NET, click Open.
    3. Browse to the Web Part project that you want to debug, and then click Open.
    4. Right-click the project name, and then click Properties.
    5. In the navigation tree, double-click Configuration Properties.
    6. Under Outputs, verify that the value for Output Path matches the following line:

      remote_drive_on_Server_B:\InetPub\WWWRoot\bin\

    7. In Windows Explorer, browse to the following folder:

      remote_drive_on_Server_B:\InetPub\WWWRoot\bin\.

    8. Double-click the Web.config file.
    9. In the Web.config file, search for the <SafeControls> tag.
    10. Verify that your assembly is listed as a Safe Control. If not, add the following line to the Safe Controls list.
      <SafeControl Assembly="assembly_name, Version=assembly_version,
      Culture=assembly_culture, PublicKeyToken=assembly_public_key_token"
      Namespace="assembly_namespace" TypeName="*" Safe="True"/>
    11. Save and close the file.
  6. On Server_B, install and configure the remote debugging services.

For more information about remote debugging, visit the following MSDN Web site: Visual Studio: Setting Up Remote Debugging.

Problems Saving Output

When you debug or modify an assembly, you may receive the following error message:

Unable to replace file_name.dll after compilation.

This behavior may occur if the W3wp.exe process locks the old copy of the assembly located in the InetPub\WWWRoot\bin directory. To resolve this issue, use Task Manager to end the W3wp.exe process, recompile the assembly, and then resume the debugging process.

Conclusion

Web Parts for Windows SharePoint Services are ASP.NET server controls. Therefore, the process for debugging Web Parts is similar to the process for debugging ASP.NET server controls.