本文整理汇总了VB.NET中System.Diagnostics.SymbolStore.ISymbolDocumentWriter接口的典型用法代码示例。如果您正苦于以下问题:VB.NET ISymbolDocumentWriter接口的具体用法?VB.NET ISymbolDocumentWriter怎么用?VB.NET ISymbolDocumentWriter使用的例子?那么恭喜您, 这里精选的接口代码示例或许可以为您提供帮助。
在下文中一共展示了ISymbolDocumentWriter接口的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: New
' 导入命名空间
Imports System.Reflection
Imports System.Reflection.Emit
Imports System.Resources
Imports System.Diagnostics.SymbolStore
Namespace ILGenServer
Public Class CodeGenerator
Private myModuleBuilder As ModuleBuilder
Private myAssemblyBuilder As AssemblyBuilder
Public Sub New()
' Get the current application domain for the current thread.
Dim currentDomain As AppDomain = AppDomain.CurrentDomain
Dim myAssemblyName As 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.
Dim myDocument As ISymbolDocumentWriter = myModuleBuilder.DefineDocument("RTAsm.il", _
SymDocumentType.Text, SymLanguageType.ILAssembly, SymLanguageVendor.Microsoft)
Console.WriteLine("The object representing the defined document is:" + _
CObj(myDocument).ToString())
End Sub
End Class
Public Class CallerClass
Public Shared Sub Main()
Dim myGenerator As New CodeGenerator()
End Sub
End Class
End Namespace 'ILGenServer