다음을 통해 공유


ServerDocument.DeploymentManifestUrl 속성

문서와 연결된 사용자 지정에 대한 배포 매니페스트 URL을 가져오거나 설정합니다.

네임스페이스:  Microsoft.VisualStudio.Tools.Applications
어셈블리:  Microsoft.VisualStudio.Tools.Applications.ServerDocument(Microsoft.VisualStudio.Tools.Applications.ServerDocument.dll)

구문

‘선언
Public Property DeploymentManifestUrl As Uri
public Uri DeploymentManifestUrl { get; set; }

속성 값

형식: System.Uri
문서와 연결된 사용자 지정에 대한 배포 매니페스트의 이름 및 위치를 지정하는 URL입니다.

설명

사용자 지정의 배포 매니페스트를 다른 위치로 이동하고 문서에서 사용자 지정 업데이트를 새 위치에서 찾도록 하려면 이 속성을 새 URL로 설정합니다.이 속성을 설정하는 경우 URL은 문서와 이미 연결된 사용자 지정의 배포 매니페스트를 가리켜야 합니다.

이 속성을 사용하여 새 사용자 지정을 문서와 연결할 수는 없습니다.사용자 지정되지 않은 문서에 사용자 지정을 추가하려면 AddCustomization 메서드를 사용합니다.사용자 지정된 문서에 다른 사용자 지정을 추가하려면 먼저 RemoveCustomization 메서드를 사용하여 현재 사용자 지정을 제거한 다음 AddCustomization 메서드를 사용합니다.

.NET Framework 3.5 대상 응용 프로그램에서 URL 가져오기

.NET Framework 3.5를 대상으로 하는 응용 프로그램의 Microsoft.VisualStudio.Tools.Applications.ServerDocument.v10.0.dll 어셈블리에서 ServerDocument 클래스를 사용할 경우 DeploymentManifestUrl 속성은 문서 수준 사용자 지정이 응용 프로그램을 실행 중인 컴퓨터에 설치되어 있는 경우에만 현재 배포 매니페스트 URL을 반환합니다.그렇지 않은 경우 nullNull 참조(Visual Basic의 경우 Nothing)을 반환합니다.

응용 프로그램을 실행 중인 컴퓨터(예: 문서 수준 사용자 지정이 게시되는 서버)에 설치되지 않은 문서 수준 사용자 지정의 배포 매니페스트 URL을 가져와야 하는 경우 응용 프로그램에서 .NET Framework 4를 대상으로 하고 Microsoft.VisualStudio.Tools.Applications.ServerDocument.dll 어셈블리를 참조하며 해당 어셈블리에서 ServerDocument 클래스를 사용합니다.

예제

다음 코드 예제에서는 ServerDocument(String) 생성자를 사용하여 지정된 문서를 로드하는 새 ServerDocument를 만듭니다.그런 다음 문서와 연결된 사용자 지정의 배포 매니페스트 URL을 표시합니다.

이 예제에는 다음 사항이 필요합니다.

  • 콘솔 응용 프로그램 프로젝트 또는 다른 비 Office 프로젝트입니다.

  • 다음 어셈블리에 대한 참조:

    • Microsoft.VisualStudio.Tools.Applications.ServerDocument.dll 및 Microsoft.VisualStudio.Tools.Applications.Runtime.dll (경우 프로젝트가 대상으로 .NET Framework 4 또는 .NET Framework 4.5).

      또는

    • Microsoft.VisualStudio.Tools.Applications.ServerDocument.v10.0.dll 및 Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0.dll(.NET Framework 3.5를 대상으로 하는 프로젝트의 경우)

  • 코드 파일 상단에 있는 Microsoft.VisualStudio.Tools.ApplicationsMicrosoft.VisualStudio.Tools.Applications.Runtime 네임스페이스에 대해 Imports(Visual Basic의 경우) 또는 using(C#의 경우) 문.

Private Sub CreateServerDocumentFromPath(ByVal documentPath As String)
    Dim runtimeVersion As Integer = 0
    Dim serverDocument1 As ServerDocument = Nothing

    Try
        runtimeVersion = ServerDocument.GetCustomizationVersion(documentPath)
        If runtimeVersion = 3 Then
            serverDocument1 = New ServerDocument(documentPath)
            MessageBox.Show("The URL of the deployment manifest is: " & vbLf & _
                serverDocument1.DeploymentManifestUrl.ToString())
        End If

    Catch ex As System.IO.FileNotFoundException
        System.Windows.Forms.MessageBox.Show("The specified document does not exist.")
    Catch ex As UnknownCustomizationFileException
        System.Windows.Forms.MessageBox.Show("The specified document has a file " & _
            "extension that is not supported by Visual Studio Tools for Office.")
    Finally
        If Not (serverDocument1 Is Nothing) Then
            serverDocument1.Close()
        End If
    End Try
End Sub
private void CreateServerDocumentFromPath(string documentPath)
{
    int runtimeVersion = 0;
    ServerDocument serverDocument1 = null;

    try
    {
        runtimeVersion = ServerDocument.GetCustomizationVersion(documentPath);
        if (runtimeVersion == 3)
        {
            serverDocument1 = new ServerDocument(documentPath);
            MessageBox.Show("The URL of the deployment manifest is: \n" +
                serverDocument1.DeploymentManifestUrl.ToString());
        }
    }
    catch (System.IO.FileNotFoundException)
    {
        System.Windows.Forms.MessageBox.Show("The specified document does not exist.");
    }
    catch (UnknownCustomizationFileException)
    {
        System.Windows.Forms.MessageBox.Show("The specified document has a file " +
            "extension that is not supported by Visual Studio Tools for Office.");
    }
    finally
    {
        if (serverDocument1 != null)
            serverDocument1.Close();
    }
}

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

ServerDocument 클래스

Microsoft.VisualStudio.Tools.Applications 네임스페이스