DocumentNotCustomizedException 类 (2007 system)

更新:2007 年 11 月

试图使用 ServerDocument 类对文档执行无效操作时引发的异常。

命名空间:  Microsoft.VisualStudio.Tools.Applications.Runtime
程序集:  Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0(在 Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0.dll 中)

语法

声明
<SerializableAttribute> _
<PermissionSetAttribute(SecurityAction.Demand, Name := "FullTrust")> _
Public NotInheritable Class DocumentNotCustomizedException _
    Inherits RuntimeException
用法
Dim instance As DocumentNotCustomizedException
[SerializableAttribute]
[PermissionSetAttribute(SecurityAction.Demand, Name = "FullTrust")]
public sealed class DocumentNotCustomizedException : RuntimeException

备注

在下列情况下会引发此异常:

  • 使用 ServerDocument.ServerDocument 构造函数打开还不具有 Visual Studio Tools for Office 自定义项的文档,并且试图以只读模式打开该文档时。

  • 试图使用 AddCustomization 方法将自定义项附加到文档,而该文档已损坏或其权限受限制时。

继承层次结构

System.Object
  System.Exception
    Microsoft.VisualStudio.Tools.Applications.Runtime.RuntimeException
      Microsoft.VisualStudio.Tools.Applications.Runtime.DocumentNotCustomizedException

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

另请参见

参考

DocumentNotCustomizedException 成员

Microsoft.VisualStudio.Tools.Applications.Runtime 命名空间