Export (0) Print
Expand All

ISymbolDocumentWriter Interface

Represents a document referenced by a symbol store.

Namespace:  System.Diagnostics.SymbolStore
Assembly:  mscorlib (in mscorlib.dll)

[ComVisibleAttribute(true)]
public interface ISymbolDocumentWriter

The ISymbolDocumentWriter type exposes the following members.

  NameDescription
Public methodSetCheckSumSets checksum information.
Public methodSetSourceStores the raw source for a document in the symbol store.
Top

A document is defined by a URL and a document type GUID. Optionally, the document source can be stored in the symbol store.

NoteNote

This interface is the managed counterpart of the ISymUnmanagedDocumentWriter interface, which is one of the unmanaged symbol store interfaces that provide an alternate way to read and write debug symbol information.

The following code example demonstrates how an ISymbolDocumentWriter can be obtained when calling DefineDocument.

using System;
using System.Reflection;
using System.Reflection.Emit;
using System.Resources;
using System.Diagnostics.SymbolStore;

namespace ILGenServer
{
   public class CodeGenerator
   {
      ModuleBuilder myModuleBuilder ;
      AssemblyBuilder myAssemblyBuilder ;

      public CodeGenerator()
      {

         // Get the current application domain for the current thread.
         AppDomain currentDomain = AppDomain.CurrentDomain;
         AssemblyName myAssemblyName = new AssemblyName();
         myAssemblyName.Name = "TempAssembly";

         // Define a dynamic assembly in the current domain.
         myAssemblyBuilder =
            currentDomain.DefineDynamicAssembly
                        (myAssemblyName, AssemblyBuilderAccess.RunAndSave);
         // Define a dynamic module in "TempAssembly" assembly.
         myModuleBuilder =
            myAssemblyBuilder.DefineDynamicModule("TempModule","Resource.mod",true);

         // Define a document for source.on 'TempModule' module.
         ISymbolDocumentWriter myDocument =
         myModuleBuilder.DefineDocument("RTAsm.il", SymDocumentType.Text,
                  SymLanguageType.ILAssembly,SymLanguageVendor.Microsoft);

         Console.WriteLine("The object representing the defined document is:"+myDocument);

      }
   }
   public class CallerClass
   {
      public static void Main()
      {
         CodeGenerator myGenerator = new CodeGenerator();
      }
   }
}

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft