-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathModuleBuilder.xml
More file actions
4204 lines (4018 loc) · 295 KB
/
Copy pathModuleBuilder.xml
File metadata and controls
4204 lines (4018 loc) · 295 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<Type Name="ModuleBuilder" FullName="System.Reflection.Emit.ModuleBuilder">
<TypeSignature Language="C#" Value="public abstract class ModuleBuilder : System.Reflection.Module" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit ModuleBuilder extends System.Reflection.Module" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0" />
<TypeSignature Language="DocId" Value="T:System.Reflection.Emit.ModuleBuilder" />
<TypeSignature Language="VB.NET" Value="Public MustInherit Class ModuleBuilder
Inherits Module" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0" />
<TypeSignature Language="F#" Value="type ModuleBuilder = class
 inherit Module" />
<TypeSignature Language="C++ CLI" Value="public ref class ModuleBuilder abstract : System::Reflection::Module" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0" />
<TypeSignature Language="C#" Value="public class ModuleBuilder : System.Reflection.Module" FrameworkAlternate="net-5.0;net-6.0;net-7.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ModuleBuilder extends System.Reflection.Module" FrameworkAlternate="net-5.0;net-6.0;net-7.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1" />
<TypeSignature Language="VB.NET" Value="Public Class ModuleBuilder
Inherits Module" FrameworkAlternate="net-5.0;net-6.0;net-7.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1" />
<TypeSignature Language="C++ CLI" Value="public ref class ModuleBuilder : System::Reflection::Module" FrameworkAlternate="net-5.0;net-6.0;net-7.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1" />
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Reflection.Emit" ToVersion="10.0.0.0" FrameworkAlternate="net-10.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Reflection.Emit" ToVersion="11.0.0.0" FrameworkAlternate="net-11.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Reflection.Emit" ToVersion="5.0.0.0" FrameworkAlternate="net-5.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Reflection.Emit" ToVersion="6.0.0.0" FrameworkAlternate="net-6.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Reflection.Emit" ToVersion="7.0.0.0" FrameworkAlternate="net-7.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Reflection.Emit" ToVersion="8.0.0.0" FrameworkAlternate="net-8.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Reflection.Emit" ToVersion="9.0.0.0" FrameworkAlternate="net-9.0" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.Reflection.Module</BaseTypeName>
</Base>
<Interfaces>
</Interfaces>
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(0)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(0)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Defines and represents a module in a dynamic assembly.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
To get an instance of <xref:System.Reflection.Emit.ModuleBuilder>, use the <xref:System.Reflection.Emit.AssemblyBuilder.DefineDynamicModule*?displayProperty=nameWithType> method.
## Examples
The following code sample demonstrates the use of `ModuleBuilder` to create a dynamic module. Note that the ModuleBuilder is created by calling <xref:System.Reflection.Emit.AssemblyBuilder.DefineDynamicModule*> in <xref:System.Reflection.Emit.AssemblyBuilder>, rather than through a constructor.
:::code language="csharp" source="~/snippets/csharp/System.Reflection.Emit/ModuleBuilder/Overview/modulebuilder.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Reflection.Emit/ModuleBuilder/Overview/modulebuilder.vb" id="Snippet1":::
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected ModuleBuilder ();" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0" />
<MemberSignature Language="DocId" Value="M:System.Reflection.Emit.ModuleBuilder.#ctor" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0" />
<MemberSignature Language="VB.NET" Value="Protected Sub New ()" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0" />
<MemberSignature Language="C++ CLI" Value="protected:
 ModuleBuilder();" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit</AssemblyName>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Reflection.Emit.ModuleBuilder" /> class.</summary>
<remarks>This constructor is invoked by derived classes.</remarks>
</Docs>
</Member>
<Member MemberName="Assembly">
<MemberSignature Language="C#" Value="public override System.Reflection.Assembly Assembly { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Reflection.Assembly Assembly" />
<MemberSignature Language="DocId" Value="P:System.Reflection.Emit.ModuleBuilder.Assembly" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property Assembly As Assembly" />
<MemberSignature Language="F#" Value="member this.Assembly : System.Reflection.Assembly" Usage="System.Reflection.Emit.ModuleBuilder.Assembly" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual property System::Reflection::Assembly ^ Assembly { System::Reflection::Assembly ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Reflection.Assembly</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the dynamic assembly that defined this instance of <see cref="T:System.Reflection.Emit.ModuleBuilder" />.</summary>
<value>The dynamic assembly that defined the current dynamic module.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Reflection.Assembly> object that is returned is the <xref:System.Reflection.Emit.AssemblyBuilder> that defined this instance of <xref:System.Reflection.Emit.ModuleBuilder>.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CreateGlobalFunctions">
<MemberSignature Language="C#" Value="public void CreateGlobalFunctions ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void CreateGlobalFunctions() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Reflection.Emit.ModuleBuilder.CreateGlobalFunctions" />
<MemberSignature Language="VB.NET" Value="Public Sub CreateGlobalFunctions ()" />
<MemberSignature Language="F#" Value="member this.CreateGlobalFunctions : unit -> unit" Usage="moduleBuilder.CreateGlobalFunctions " />
<MemberSignature Language="C++ CLI" Value="public:
 void CreateGlobalFunctions();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Completes the global function definitions and global data definitions for this dynamic module.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method should be called when the user is done with defining all the global functions within this dynamic module. After calling this function, no more new global functions or new global data are allowed.
## Examples
The following sample illustrates the use of `CreateGlobalFunctions` to create a static global method from a <xref:System.Reflection.Emit.MethodBuilder> implemented with <xref:System.Reflection.Emit.ModuleBuilder.DefineGlobalMethod*>.
:::code language="csharp" source="~/snippets/csharp/System.Reflection.Emit/ModuleBuilder/CreateGlobalFunctions/modulebuilder_createglobalfunctions.cs" id="Snippet2":::
:::code language="vb" source="~/snippets/visualbasic/System.Reflection.Emit/ModuleBuilder/CreateGlobalFunctions/modulebuilder_createglobalfunctions.vb" id="Snippet2":::
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">This method was called previously.</exception>
</Docs>
</Member>
<Member MemberName="CreateGlobalFunctionsCore">
<MemberSignature Language="C#" Value="protected abstract void CreateGlobalFunctionsCore ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void CreateGlobalFunctionsCore() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Reflection.Emit.ModuleBuilder.CreateGlobalFunctionsCore" />
<MemberSignature Language="VB.NET" Value="Protected MustOverride Sub CreateGlobalFunctionsCore ()" />
<MemberSignature Language="F#" Value="abstract member CreateGlobalFunctionsCore : unit -> unit" Usage="moduleBuilder.CreateGlobalFunctionsCore " />
<MemberSignature Language="C++ CLI" Value="protected:
 abstract void CreateGlobalFunctionsCore();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit</AssemblyName>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>When overridden in a derived class, completes the global function definitions and global data definitions for this dynamic module.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="DefineDocument">
<MemberSignature Language="C#" Value="public System.Diagnostics.SymbolStore.ISymbolDocumentWriter DefineDocument (string url, Guid language = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Diagnostics.SymbolStore.ISymbolDocumentWriter DefineDocument(string url, valuetype System.Guid language) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Reflection.Emit.ModuleBuilder.DefineDocument(System.String,System.Guid)" />
<MemberSignature Language="VB.NET" Value="Public Function DefineDocument (url As String, Optional language As Guid = Nothing) As ISymbolDocumentWriter" />
<MemberSignature Language="F#" Value="member this.DefineDocument : string * Guid -> System.Diagnostics.SymbolStore.ISymbolDocumentWriter" Usage="moduleBuilder.DefineDocument (url, language)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit</AssemblyName>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Diagnostics.SymbolStore.ISymbolDocumentWriter</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="url" Type="System.String" Index="0" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
<Parameter Name="language" Type="System.Guid" Index="1" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
</Parameters>
<Docs>
<param name="url">The URL for the document.</param>
<param name="language">The GUID that identifies the document language. This is optional.</param>
<summary>Defines a document for source.</summary>
<returns>The defined document.</returns>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="url" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">This method is called on a dynamic module that is not a persisted module.</exception>
</Docs>
</Member>
<Member MemberName="DefineDocument">
<MemberSignature Language="C#" Value="public System.Diagnostics.SymbolStore.ISymbolDocumentWriter DefineDocument (string url, Guid language, Guid languageVendor, Guid documentType);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Diagnostics.SymbolStore.ISymbolDocumentWriter DefineDocument(string url, valuetype System.Guid language, valuetype System.Guid languageVendor, valuetype System.Guid documentType) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Reflection.Emit.ModuleBuilder.DefineDocument(System.String,System.Guid,System.Guid,System.Guid)" />
<MemberSignature Language="VB.NET" Value="Public Function DefineDocument (url As String, language As Guid, languageVendor As Guid, documentType As Guid) As ISymbolDocumentWriter" />
<MemberSignature Language="F#" Value="member this.DefineDocument : string * Guid * Guid * Guid -> System.Diagnostics.SymbolStore.ISymbolDocumentWriter" Usage="moduleBuilder.DefineDocument (url, language, languageVendor, documentType)" />
<MemberSignature Language="C++ CLI" Value="public:
 System::Diagnostics::SymbolStore::ISymbolDocumentWriter ^ DefineDocument(System::String ^ url, Guid language, Guid languageVendor, Guid documentType);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit</AssemblyName>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-9.0">
<AttributeName Language="C#">[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Diagnostics.SymbolStore.ISymbolDocumentWriter</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="url" Type="System.String" Index="0" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
<Parameter Name="language" Type="System.Guid" Index="1" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
<Parameter Name="languageVendor" Type="System.Guid" Index="2" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
<Parameter Name="documentType" Type="System.Guid" Index="3" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
</Parameters>
<Docs>
<param name="url">The URL for the document.</param>
<param name="language">The GUID that identifies the document language. This can be <see cref="F:System.Guid.Empty" />.</param>
<param name="languageVendor">The GUID that identifies the document language vendor. This can be <see cref="F:System.Guid.Empty" />.</param>
<param name="documentType">The GUID that identifies the document type. This can be <see cref="F:System.Guid.Empty" />.</param>
<summary>Defines a document for source.</summary>
<returns>The defined document.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code sample illustrates the use of `DefineDocument` to attach an external symbol document (in this case, a raw IL file) to a dynamic module.
:::code language="csharp" source="~/snippets/csharp/System.Diagnostics.SymbolStore/ISymbolDocumentWriter/Overview/modulebuilder_definedocument.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Diagnostics.SymbolStore/ISymbolDocumentWriter/Overview/modulebuilder_definedocument.vb" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="url" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">This method is called on a dynamic module that is not a debug module.</exception>
</Docs>
</Member>
<Member MemberName="DefineDocumentCore">
<MemberSignature Language="C#" Value="protected virtual System.Diagnostics.SymbolStore.ISymbolDocumentWriter DefineDocumentCore (string url, Guid language = default);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Diagnostics.SymbolStore.ISymbolDocumentWriter DefineDocumentCore(string url, valuetype System.Guid language) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Reflection.Emit.ModuleBuilder.DefineDocumentCore(System.String,System.Guid)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function DefineDocumentCore (url As String, Optional language As Guid = Nothing) As ISymbolDocumentWriter" />
<MemberSignature Language="F#" Value="abstract member DefineDocumentCore : string * Guid -> System.Diagnostics.SymbolStore.ISymbolDocumentWriter
override this.DefineDocumentCore : string * Guid -> System.Diagnostics.SymbolStore.ISymbolDocumentWriter" Usage="moduleBuilder.DefineDocumentCore (url, language)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit</AssemblyName>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Diagnostics.SymbolStore.ISymbolDocumentWriter</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="url" Type="System.String" Index="0" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
<Parameter Name="language" Type="System.Guid" Index="1" FrameworkAlternate="net-10.0;net-11.0;net-9.0" />
</Parameters>
<Docs>
<param name="url">The URL for the document.</param>
<param name="language">The GUID that identifies the document language. This is optional.</param>
<summary>When override in a derived class, defines a document for source.</summary>
<returns>The defined document.</returns>
<remarks>To be added.</remarks>
<exception cref="T:System.InvalidOperationException">This method is called on a dynamic module that is not a debug module.</exception>
</Docs>
</Member>
<Member MemberName="DefineEnum">
<MemberSignature Language="C#" Value="public System.Reflection.Emit.EnumBuilder DefineEnum (string name, System.Reflection.TypeAttributes visibility, Type underlyingType);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Reflection.Emit.EnumBuilder DefineEnum(string name, valuetype System.Reflection.TypeAttributes visibility, class System.Type underlyingType) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Reflection.Emit.ModuleBuilder.DefineEnum(System.String,System.Reflection.TypeAttributes,System.Type)" />
<MemberSignature Language="VB.NET" Value="Public Function DefineEnum (name As String, visibility As TypeAttributes, underlyingType As Type) As EnumBuilder" />
<MemberSignature Language="F#" Value="member this.DefineEnum : string * System.Reflection.TypeAttributes * Type -> System.Reflection.Emit.EnumBuilder" Usage="moduleBuilder.DefineEnum (name, visibility, underlyingType)" />
<MemberSignature Language="C++ CLI" Value="public:
 System::Reflection::Emit::EnumBuilder ^ DefineEnum(System::String ^ name, System::Reflection::TypeAttributes visibility, Type ^ underlyingType);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Reflection.Emit.EnumBuilder</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
<Parameter Name="visibility" Type="System.Reflection.TypeAttributes" />
<Parameter Name="underlyingType" Type="System.Type" />
</Parameters>
<Docs>
<param name="name">The full path of the enumeration type. <paramref name="name" /> cannot contain embedded nulls.</param>
<param name="visibility">The type attributes for the enumeration. The attributes are any bits defined by <see cref="F:System.Reflection.TypeAttributes.VisibilityMask" />.</param>
<param name="underlyingType">The underlying type for the enumeration. This must be a built-in integer type.</param>
<summary>Defines an enumeration type that is a value type with a single non-static field called <paramref name="value__" /> of the specified type.</summary>
<returns>The defined enumeration.</returns>
<remarks>
<format type="text/markdown"><.
## Examples
The following example illustrates the use of `DefineEnum` to implement an enumeration class in a dynamic module. The example defines an enumeration named `Elevation` that has an underlying type of <xref:System.Int32>, and creates two elements: `Low`, with a value of 0, and `High`, with a value of 1. After the type has been created, the assembly is saved with the name `TempAssembly.dll`. You can use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the contents of this assembly.
:::code language="csharp" source="~/snippets/csharp/System.Reflection.Emit/EnumBuilder/Overview/modulebuilder_defineenum.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Reflection.Emit/EnumBuilder/Overview/modulebuilder_defineenum.vb" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">Attributes other than visibility attributes are provided.
-or-
An enumeration with the given name exists in the parent assembly of this module.
-or-
The visibility attributes do not match the scope of the enumeration. For example, <see cref="F:System.Reflection.TypeAttributes.NestedPublic" /> is specified for <paramref name="visibility" />, but the enumeration is not a nested type.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="name" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="DefineEnumCore">
<MemberSignature Language="C#" Value="protected abstract System.Reflection.Emit.EnumBuilder DefineEnumCore (string name, System.Reflection.TypeAttributes visibility, Type underlyingType);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Reflection.Emit.EnumBuilder DefineEnumCore(string name, valuetype System.Reflection.TypeAttributes visibility, class System.Type underlyingType) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Reflection.Emit.ModuleBuilder.DefineEnumCore(System.String,System.Reflection.TypeAttributes,System.Type)" />
<MemberSignature Language="VB.NET" Value="Protected MustOverride Function DefineEnumCore (name As String, visibility As TypeAttributes, underlyingType As Type) As EnumBuilder" />
<MemberSignature Language="F#" Value="abstract member DefineEnumCore : string * System.Reflection.TypeAttributes * Type -> System.Reflection.Emit.EnumBuilder" Usage="moduleBuilder.DefineEnumCore (name, visibility, underlyingType)" />
<MemberSignature Language="C++ CLI" Value="protected:
 abstract System::Reflection::Emit::EnumBuilder ^ DefineEnumCore(System::String ^ name, System::Reflection::TypeAttributes visibility, Type ^ underlyingType);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit</AssemblyName>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Reflection.Emit.EnumBuilder</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" Index="0" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0" />
<Parameter Name="visibility" Type="System.Reflection.TypeAttributes" Index="1" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0" />
<Parameter Name="underlyingType" Type="System.Type" Index="2" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0" />
</Parameters>
<Docs>
<param name="name">The full path of the enumeration type. <paramref name="name" /> cannot contain embedded nulls.</param>
<param name="visibility">A bitwise combination of the enumeration values that specifies the type attributes for the enumeration visibility. The attributes are any bits defined by <see cref="F:System.Reflection.TypeAttributes.VisibilityMask" />.</param>
<param name="underlyingType">The underlying type for the enumeration. This must be a built-in integer type.</param>
<summary>When overridden in a derived class, defines an enumeration type that is a value type with a single non-static field called value__ of the specified type.</summary>
<returns>The defined enumeration.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<MemberGroup MemberName="DefineGlobalMethod">
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Defines a global method.</summary>
</Docs>
</MemberGroup>
<Member MemberName="DefineGlobalMethod">
<MemberSignature Language="C#" Value="public System.Reflection.Emit.MethodBuilder DefineGlobalMethod (string name, System.Reflection.MethodAttributes attributes, Type? returnType, Type[]? parameterTypes);" FrameworkAlternate="net-10.0;net-11.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-3.0;netcore-3.1" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Reflection.Emit.MethodBuilder DefineGlobalMethod(string name, valuetype System.Reflection.MethodAttributes attributes, class System.Type returnType, class System.Type[] parameterTypes) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Reflection.Emit.ModuleBuilder.DefineGlobalMethod(System.String,System.Reflection.MethodAttributes,System.Type,System.Type[])" />
<MemberSignature Language="VB.NET" Value="Public Function DefineGlobalMethod (name As String, attributes As MethodAttributes, returnType As Type, parameterTypes As Type()) As MethodBuilder" />
<MemberSignature Language="F#" Value="member this.DefineGlobalMethod : string * System.Reflection.MethodAttributes * Type * Type[] -> System.Reflection.Emit.MethodBuilder" Usage="moduleBuilder.DefineGlobalMethod (name, attributes, returnType, parameterTypes)" />
<MemberSignature Language="C++ CLI" Value="public:
 System::Reflection::Emit::MethodBuilder ^ DefineGlobalMethod(System::String ^ name, System::Reflection::MethodAttributes attributes, Type ^ returnType, cli::array <Type ^> ^ parameterTypes);" />
<MemberSignature Language="C#" Value="public System.Reflection.Emit.MethodBuilder DefineGlobalMethod (string name, System.Reflection.MethodAttributes attributes, Type returnType, Type[] parameterTypes);" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Reflection.Emit.MethodBuilder</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
<Parameter Name="attributes" Type="System.Reflection.MethodAttributes" />
<Parameter Name="returnType" Type="System.Type">
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(2)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(2)>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
<Parameter Name="parameterTypes" Type="System.Type[]">
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1 })]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1 })>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="name">The name of the method. <paramref name="name" /> cannot contain embedded nulls.</param>
<param name="attributes">The attributes of the method. <paramref name="attributes" /> must include <see cref="F:System.Reflection.MethodAttributes.Static" />.</param>
<param name="returnType">The return type of the method.</param>
<param name="parameterTypes">The types of the method's parameters.</param>
<summary>Defines a global method with the specified name, attributes, return type, and parameter types.</summary>
<returns>The defined global method.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The global method that this method defines is not usable until you call <xref:System.Reflection.Emit.ModuleBuilder.CreateGlobalFunctions*>.
## Examples
The following example illustrates the use of `DefineGlobalMethod` to create a type-independent method tied to the current <xref:System.Reflection.Emit.ModuleBuilder>. After building the global method, <xref:System.Reflection.Emit.ModuleBuilder.CreateGlobalFunctions*> must be called in order to complete it.
:::code language="csharp" source="~/snippets/csharp/System.Reflection.Emit/ModuleBuilder/CreateGlobalFunctions/modulebuilder_createglobalfunctions.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Reflection.Emit/ModuleBuilder/CreateGlobalFunctions/modulebuilder_createglobalfunctions.vb" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The method is not static. That is, <paramref name="attributes" /> does not include <see cref="F:System.Reflection.MethodAttributes.Static" />.
-or-
The length of <paramref name="name" /> is zero
-or-
An element in the <see cref="T:System.Type" /> array is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="name" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">
<see cref="M:System.Reflection.Emit.ModuleBuilder.CreateGlobalFunctions" /> has been previously called.</exception>
</Docs>
</Member>
<Member MemberName="DefineGlobalMethod">
<MemberSignature Language="C#" Value="public System.Reflection.Emit.MethodBuilder DefineGlobalMethod (string name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, Type? returnType, Type[]? parameterTypes);" FrameworkAlternate="net-10.0;net-11.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-3.0;netcore-3.1" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Reflection.Emit.MethodBuilder DefineGlobalMethod(string name, valuetype System.Reflection.MethodAttributes attributes, valuetype System.Reflection.CallingConventions callingConvention, class System.Type returnType, class System.Type[] parameterTypes) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Reflection.Emit.ModuleBuilder.DefineGlobalMethod(System.String,System.Reflection.MethodAttributes,System.Reflection.CallingConventions,System.Type,System.Type[])" />
<MemberSignature Language="VB.NET" Value="Public Function DefineGlobalMethod (name As String, attributes As MethodAttributes, callingConvention As CallingConventions, returnType As Type, parameterTypes As Type()) As MethodBuilder" />
<MemberSignature Language="F#" Value="member this.DefineGlobalMethod : string * System.Reflection.MethodAttributes * System.Reflection.CallingConventions * Type * Type[] -> System.Reflection.Emit.MethodBuilder" Usage="moduleBuilder.DefineGlobalMethod (name, attributes, callingConvention, returnType, parameterTypes)" />
<MemberSignature Language="C++ CLI" Value="public:
 System::Reflection::Emit::MethodBuilder ^ DefineGlobalMethod(System::String ^ name, System::Reflection::MethodAttributes attributes, System::Reflection::CallingConventions callingConvention, Type ^ returnType, cli::array <Type ^> ^ parameterTypes);" />
<MemberSignature Language="C#" Value="public System.Reflection.Emit.MethodBuilder DefineGlobalMethod (string name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, Type returnType, Type[] parameterTypes);" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Reflection.Emit.MethodBuilder</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
<Parameter Name="attributes" Type="System.Reflection.MethodAttributes" />
<Parameter Name="callingConvention" Type="System.Reflection.CallingConventions" />
<Parameter Name="returnType" Type="System.Type">
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(2)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(2)>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
<Parameter Name="parameterTypes" Type="System.Type[]">
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1 })]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1 })>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="name">The name of the method. <paramref name="name" /> cannot contain embedded nulls.</param>
<param name="attributes">The attributes of the method. <paramref name="attributes" /> must include <see cref="F:System.Reflection.MethodAttributes.Static" />.</param>
<param name="callingConvention">The calling convention for the method.</param>
<param name="returnType">The return type of the method.</param>
<param name="parameterTypes">The types of the method's parameters.</param>
<summary>Defines a global method with the specified name, attributes, calling convention, return type, and parameter types.</summary>
<returns>The defined global method.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You cannot use the global method that this method defines until you call <xref:System.Reflection.Emit.ModuleBuilder.CreateGlobalFunctions*>.
## Examples
The following code sample illustrates the use of `DefineGlobalMethod` to create a type-independent method tied to the current <xref:System.Reflection.Emit.ModuleBuilder>. After building the global method, <xref:System.Reflection.Emit.ModuleBuilder.CreateGlobalFunctions*> must be called in order to complete it.
:::code language="csharp" source="~/snippets/csharp/System.Reflection.Emit/ModuleBuilder/CreateGlobalFunctions/modulebuilder_createglobalfunctions.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Reflection.Emit/ModuleBuilder/CreateGlobalFunctions/modulebuilder_createglobalfunctions.vb" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The method is not static. That is, <paramref name="attributes" /> does not include <see cref="F:System.Reflection.MethodAttributes.Static" />.
-or-
An element in the <see cref="T:System.Type" /> array is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="name" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">
<see cref="M:System.Reflection.Emit.ModuleBuilder.CreateGlobalFunctions" /> has been previously called.</exception>
</Docs>
</Member>
<Member MemberName="DefineGlobalMethod">
<MemberSignature Language="C#" Value="public System.Reflection.Emit.MethodBuilder DefineGlobalMethod (string name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, Type? returnType, Type[]? requiredReturnTypeCustomModifiers, Type[]? optionalReturnTypeCustomModifiers, Type[]? parameterTypes, Type[][]? requiredParameterTypeCustomModifiers, Type[][]? optionalParameterTypeCustomModifiers);" FrameworkAlternate="net-10.0;net-11.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-3.0;netcore-3.1" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Reflection.Emit.MethodBuilder DefineGlobalMethod(string name, valuetype System.Reflection.MethodAttributes attributes, valuetype System.Reflection.CallingConventions callingConvention, class System.Type returnType, class System.Type[] requiredReturnTypeCustomModifiers, class System.Type[] optionalReturnTypeCustomModifiers, class System.Type[] parameterTypes, class System.Type[][] requiredParameterTypeCustomModifiers, class System.Type[][] optionalParameterTypeCustomModifiers) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Reflection.Emit.ModuleBuilder.DefineGlobalMethod(System.String,System.Reflection.MethodAttributes,System.Reflection.CallingConventions,System.Type,System.Type[],System.Type[],System.Type[],System.Type[][],System.Type[][])" />
<MemberSignature Language="VB.NET" Value="Public Function DefineGlobalMethod (name As String, attributes As MethodAttributes, callingConvention As CallingConventions, returnType As Type, requiredReturnTypeCustomModifiers As Type(), optionalReturnTypeCustomModifiers As Type(), parameterTypes As Type(), requiredParameterTypeCustomModifiers As Type()(), optionalParameterTypeCustomModifiers As Type()()) As MethodBuilder" />
<MemberSignature Language="F#" Value="member this.DefineGlobalMethod : string * System.Reflection.MethodAttributes * System.Reflection.CallingConventions * Type * Type[] * Type[] * Type[] * Type[][] * Type[][] -> System.Reflection.Emit.MethodBuilder" Usage="moduleBuilder.DefineGlobalMethod (name, attributes, callingConvention, returnType, requiredReturnTypeCustomModifiers, optionalReturnTypeCustomModifiers, parameterTypes, requiredParameterTypeCustomModifiers, optionalParameterTypeCustomModifiers)" />
<MemberSignature Language="C++ CLI" Value="public:
 System::Reflection::Emit::MethodBuilder ^ DefineGlobalMethod(System::String ^ name, System::Reflection::MethodAttributes attributes, System::Reflection::CallingConventions callingConvention, Type ^ returnType, cli::array <Type ^> ^ requiredReturnTypeCustomModifiers, cli::array <Type ^> ^ optionalReturnTypeCustomModifiers, cli::array <Type ^> ^ parameterTypes, cli::array <cli::array <Type ^> ^> ^ requiredParameterTypeCustomModifiers, cli::array <cli::array <Type ^> ^> ^ optionalParameterTypeCustomModifiers);" />
<MemberSignature Language="C#" Value="public System.Reflection.Emit.MethodBuilder DefineGlobalMethod (string name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, Type returnType, Type[] requiredReturnTypeCustomModifiers, Type[] optionalReturnTypeCustomModifiers, Type[] parameterTypes, Type[][] requiredParameterTypeCustomModifiers, Type[][] optionalParameterTypeCustomModifiers);" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Reflection.Emit.MethodBuilder</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
<Parameter Name="attributes" Type="System.Reflection.MethodAttributes" />
<Parameter Name="callingConvention" Type="System.Reflection.CallingConventions" />
<Parameter Name="returnType" Type="System.Type">
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(2)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(2)>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
<Parameter Name="requiredReturnTypeCustomModifiers" Type="System.Type[]">
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1 })]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1 })>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
<Parameter Name="optionalReturnTypeCustomModifiers" Type="System.Type[]">
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1 })]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1 })>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
<Parameter Name="parameterTypes" Type="System.Type[]">
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1 })]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1 })>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
<Parameter Name="requiredParameterTypeCustomModifiers" Type="System.Type[][]">
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1, 1 })]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1, 1 })>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
<Parameter Name="optionalParameterTypeCustomModifiers" Type="System.Type[][]">
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1, 1 })]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1, 1 })>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="name">The name of the method. <paramref name="name" /> cannot contain embedded null characters.</param>
<param name="attributes">The attributes of the method. <paramref name="attributes" /> must include <see cref="F:System.Reflection.MethodAttributes.Static" />.</param>
<param name="callingConvention">The calling convention for the method.</param>
<param name="returnType">The return type of the method.</param>
<param name="requiredReturnTypeCustomModifiers">An array of types representing the required custom modifiers for the return type, such as <see cref="T:System.Runtime.CompilerServices.IsConst" /> or <see cref="T:System.Runtime.CompilerServices.IsBoxed" />. If the return type has no required custom modifiers, specify <see langword="null" />.</param>
<param name="optionalReturnTypeCustomModifiers">An array of types representing the optional custom modifiers for the return type, such as <see cref="T:System.Runtime.CompilerServices.IsConst" /> or <see cref="T:System.Runtime.CompilerServices.IsBoxed" />. If the return type has no optional custom modifiers, specify <see langword="null" />.</param>
<param name="parameterTypes">The types of the method's parameters.</param>
<param name="requiredParameterTypeCustomModifiers">An array of arrays of types. Each array of types represents the required custom modifiers for the corresponding parameter of the global method. If a particular argument has no required custom modifiers, specify <see langword="null" /> instead of an array of types. If the global method has no arguments, or if none of the arguments have required custom modifiers, specify <see langword="null" /> instead of an array of arrays.</param>
<param name="optionalParameterTypeCustomModifiers">An array of arrays of types. Each array of types represents the optional custom modifiers for the corresponding parameter. If a particular argument has no optional custom modifiers, specify <see langword="null" /> instead of an array of types. If the global method has no arguments, or if none of the arguments have optional custom modifiers, specify <see langword="null" /> instead of an array of arrays.</param>
<summary>Defines a global method with the specified name, attributes, calling convention, return type, custom modifiers for the return type, parameter types, and custom modifiers for the parameter types.</summary>
<returns>The defined global method.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This overload is provided for designers of managed compilers.
You cannot use the global method that this method defines until you call <xref:System.Reflection.Emit.ModuleBuilder.CreateGlobalFunctions*>. ]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The method is not static. That is, <paramref name="attributes" /> does not include <see cref="F:System.Reflection.MethodAttributes.Static" />.
-or-
An element in the <see cref="T:System.Type" /> array is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="name" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">The <see cref="M:System.Reflection.Emit.ModuleBuilder.CreateGlobalFunctions" /> method has been previously called.</exception>
</Docs>
</Member>
<Member MemberName="DefineGlobalMethodCore">
<MemberSignature Language="C#" Value="protected abstract System.Reflection.Emit.MethodBuilder DefineGlobalMethodCore (string name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, Type? returnType, Type[]? requiredReturnTypeCustomModifiers, Type[]? optionalReturnTypeCustomModifiers, Type[]? parameterTypes, Type[][]? requiredParameterTypeCustomModifiers, Type[][]? optionalParameterTypeCustomModifiers);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Reflection.Emit.MethodBuilder DefineGlobalMethodCore(string name, valuetype System.Reflection.MethodAttributes attributes, valuetype System.Reflection.CallingConventions callingConvention, class System.Type returnType, class System.Type[] requiredReturnTypeCustomModifiers, class System.Type[] optionalReturnTypeCustomModifiers, class System.Type[] parameterTypes, class System.Type[][] requiredParameterTypeCustomModifiers, class System.Type[][] optionalParameterTypeCustomModifiers) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Reflection.Emit.ModuleBuilder.DefineGlobalMethodCore(System.String,System.Reflection.MethodAttributes,System.Reflection.CallingConventions,System.Type,System.Type[],System.Type[],System.Type[],System.Type[][],System.Type[][])" />
<MemberSignature Language="VB.NET" Value="Protected MustOverride Function DefineGlobalMethodCore (name As String, attributes As MethodAttributes, callingConvention As CallingConventions, returnType As Type, requiredReturnTypeCustomModifiers As Type(), optionalReturnTypeCustomModifiers As Type(), parameterTypes As Type(), requiredParameterTypeCustomModifiers As Type()(), optionalParameterTypeCustomModifiers As Type()()) As MethodBuilder" />
<MemberSignature Language="F#" Value="abstract member DefineGlobalMethodCore : string * System.Reflection.MethodAttributes * System.Reflection.CallingConventions * Type * Type[] * Type[] * Type[] * Type[][] * Type[][] -> System.Reflection.Emit.MethodBuilder" Usage="moduleBuilder.DefineGlobalMethodCore (name, attributes, callingConvention, returnType, requiredReturnTypeCustomModifiers, optionalReturnTypeCustomModifiers, parameterTypes, requiredParameterTypeCustomModifiers, optionalParameterTypeCustomModifiers)" />
<MemberSignature Language="C++ CLI" Value="protected:
 abstract System::Reflection::Emit::MethodBuilder ^ DefineGlobalMethodCore(System::String ^ name, System::Reflection::MethodAttributes attributes, System::Reflection::CallingConventions callingConvention, Type ^ returnType, cli::array <Type ^> ^ requiredReturnTypeCustomModifiers, cli::array <Type ^> ^ optionalReturnTypeCustomModifiers, cli::array <Type ^> ^ parameterTypes, cli::array <cli::array <Type ^> ^> ^ requiredParameterTypeCustomModifiers, cli::array <cli::array <Type ^> ^> ^ optionalParameterTypeCustomModifiers);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit</AssemblyName>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Reflection.Emit.MethodBuilder</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" Index="0" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0" />
<Parameter Name="attributes" Type="System.Reflection.MethodAttributes" Index="1" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0" />
<Parameter Name="callingConvention" Type="System.Reflection.CallingConventions" Index="2" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0" />
<Parameter Name="returnType" Type="System.Type" Index="3" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(2)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(2)>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
<Parameter Name="requiredReturnTypeCustomModifiers" Type="System.Type[]" Index="4" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1 })]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1 })>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
<Parameter Name="optionalReturnTypeCustomModifiers" Type="System.Type[]" Index="5" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1 })]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1 })>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
<Parameter Name="parameterTypes" Type="System.Type[]" Index="6" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1 })]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1 })>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
<Parameter Name="requiredParameterTypeCustomModifiers" Type="System.Type[][]" Index="7" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1, 1 })]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1, 1 })>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
<Parameter Name="optionalParameterTypeCustomModifiers" Type="System.Type[][]" Index="8" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1, 1 })]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 2, 1, 1 })>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="name">The name of the method. <paramref name="name" /> cannot contain embedded <see langword="null" /> characters.</param>
<param name="attributes">A bitwise combination of the enumeration values that specifies the attributes of the method. The attributes must include <see cref="F:System.Reflection.MethodAttributes.Static" />.</param>
<param name="callingConvention">The calling convention for the method.</param>
<param name="returnType">The return type of the method.</param>
<param name="requiredReturnTypeCustomModifiers">An array of types representing the required custom modifiers for the return type.</param>
<param name="optionalReturnTypeCustomModifiers">An array of types representing the optional custom modifiers for the return type.</param>
<param name="parameterTypes">The types of the method's parameters.</param>
<param name="requiredParameterTypeCustomModifiers">An array of arrays of types. Each array of types represents the required custom modifiers for the corresponding parameter of the global method.</param>
<param name="optionalParameterTypeCustomModifiers">An array of arrays of types. Each array of types represents the optional custom modifiers for the corresponding parameter of the global method.</param>
<summary>When overridden in a derived class, defines a global method with the specified name, attributes, calling convention, return type, custom modifiers for the return type, parameter types, and custom modifiers for the parameter types.</summary>
<returns>The defined global method.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="DefineInitializedData">
<MemberSignature Language="C#" Value="public System.Reflection.Emit.FieldBuilder DefineInitializedData (string name, byte[] data, System.Reflection.FieldAttributes attributes);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Reflection.Emit.FieldBuilder DefineInitializedData(string name, unsigned int8[] data, valuetype System.Reflection.FieldAttributes attributes) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Reflection.Emit.ModuleBuilder.DefineInitializedData(System.String,System.Byte[],System.Reflection.FieldAttributes)" />
<MemberSignature Language="VB.NET" Value="Public Function DefineInitializedData (name As String, data As Byte(), attributes As FieldAttributes) As FieldBuilder" />
<MemberSignature Language="F#" Value="member this.DefineInitializedData : string * byte[] * System.Reflection.FieldAttributes -> System.Reflection.Emit.FieldBuilder" Usage="moduleBuilder.DefineInitializedData (name, data, attributes)" />
<MemberSignature Language="C++ CLI" Value="public:
 System::Reflection::Emit::FieldBuilder ^ DefineInitializedData(System::String ^ name, cli::array <System::Byte> ^ data, System::Reflection::FieldAttributes attributes);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Reflection.Emit.FieldBuilder</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
<Parameter Name="data" Type="System.Byte[]" />
<Parameter Name="attributes" Type="System.Reflection.FieldAttributes" />
</Parameters>
<Docs>
<param name="name">The name used to refer to the data. <paramref name="name" /> cannot contain embedded nulls.</param>
<param name="data">The binary large object (BLOB) of data.</param>
<param name="attributes">The attributes for the field. The default is <see langword="Static" />.</param>
<summary>Defines an initialized data field in the .sdata section of the portable executable (PE) file.</summary>
<returns>A field to reference the data.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Reflection.FieldAttributes.Static> is automatically included in `attributes`.
The data defined by this method is not created until the <xref:System.Reflection.Emit.ModuleBuilder.CreateGlobalFunctions*> method is called.
## Examples
The following example uses the <xref:System.Reflection.Emit.ModuleBuilder.DefineInitializedData*> method to define an initialized data field in the `.sdata` section of the portable executable (PE) file.
:::code language="csharp" source="~/snippets/csharp/System.Reflection.Emit/ModuleBuilder/DefineInitializedData/modulebuilder_defineinitializeddata.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Reflection.Emit/ModuleBuilder/DefineInitializedData/modulebuilder_defineinitializeddata.vb" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The length of <paramref name="name" /> is zero.
-or-
The size of <paramref name="data" /> is less than or equal to zero or greater than or equal to 0x3f0000.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="name" /> or <paramref name="data" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">
<see cref="M:System.Reflection.Emit.ModuleBuilder.CreateGlobalFunctions" /> has been previously called.</exception>
</Docs>
</Member>
<Member MemberName="DefineInitializedDataCore">
<MemberSignature Language="C#" Value="protected abstract System.Reflection.Emit.FieldBuilder DefineInitializedDataCore (string name, byte[] data, System.Reflection.FieldAttributes attributes);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Reflection.Emit.FieldBuilder DefineInitializedDataCore(string name, unsigned int8[] data, valuetype System.Reflection.FieldAttributes attributes) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Reflection.Emit.ModuleBuilder.DefineInitializedDataCore(System.String,System.Byte[],System.Reflection.FieldAttributes)" />
<MemberSignature Language="VB.NET" Value="Protected MustOverride Function DefineInitializedDataCore (name As String, data As Byte(), attributes As FieldAttributes) As FieldBuilder" />
<MemberSignature Language="F#" Value="abstract member DefineInitializedDataCore : string * byte[] * System.Reflection.FieldAttributes -> System.Reflection.Emit.FieldBuilder" Usage="moduleBuilder.DefineInitializedDataCore (name, data, attributes)" />
<MemberSignature Language="C++ CLI" Value="protected:
 abstract System::Reflection::Emit::FieldBuilder ^ DefineInitializedDataCore(System::String ^ name, cli::array <System::Byte> ^ data, System::Reflection::FieldAttributes attributes);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Reflection.Emit</AssemblyName>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Reflection.Emit.FieldBuilder</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" Index="0" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0" />
<Parameter Name="data" Type="System.Byte[]" Index="1" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0" />
<Parameter Name="attributes" Type="System.Reflection.FieldAttributes" Index="2" FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0" />
</Parameters>
<Docs>
<param name="name">The name used to refer to the data. <paramref name="name" /> cannot contain embedded nulls.</param>
<param name="data">The binary large object (BLOB) of data.</param>
<param name="attributes">A bitwise combination of the enumeration values that specifies the attributes for the field. The default is <see langword="Static" />.</param>
<summary>When overridden in a derived class, defines an initialized data field in the .sdata section of the portable executable (PE) file.</summary>
<returns>A field to reference the data.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<MemberGroup MemberName="DefinePInvokeMethod">
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Defines a <see langword="PInvoke" /> method.</summary>
</Docs>
</MemberGroup>
<Member MemberName="DefinePInvokeMethod">
<MemberSignature Language="C#" Value="public System.Reflection.Emit.MethodBuilder DefinePInvokeMethod (string name, string dllName, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, Type? returnType, Type[]? parameterTypes, System.Runtime.InteropServices.CallingConvention nativeCallConv, System.Runtime.InteropServices.CharSet nativeCharSet);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Reflection.Emit.MethodBuilder DefinePInvokeMethod(string name, string dllName, valuetype System.Reflection.MethodAttributes attributes, valuetype System.Reflection.CallingConventions callingConvention, class System.Type returnType, class System.Type[] parameterTypes, valuetype System.Runtime.InteropServices.CallingConvention nativeCallConv, valuetype System.Runtime.InteropServices.CharSet nativeCharSet) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Reflection.Emit.ModuleBuilder.DefinePInvokeMethod(System.String,System.String,System.Reflection.MethodAttributes,System.Reflection.CallingConventions,System.Type,System.Type[],System.Runtime.InteropServices.CallingConvention,System.Runtime.InteropServices.CharSet)" />
<MemberSignature Language="VB.NET" Value="Public Function DefinePInvokeMethod (name As String, dllName As String, attributes As MethodAttributes, callingConvention As CallingConventions, returnType As Type, parameterTypes As Type(), nativeCallConv As CallingConvention, nativeCharSet As CharSet) As MethodBuilder" />
<MemberSignature Language="F#" Value="member this.DefinePInvokeMethod : string * string * System.Reflection.MethodAttributes * System.Reflection.CallingConventions * Type * Type[] * System.Runtime.InteropServices.CallingConvention * System.Runtime.InteropServices.CharSet -> System.Reflection.Emit.MethodBuilder" Usage="moduleBuilder.DefinePInvokeMethod (name, dllName, attributes, callingConvention, returnType, parameterTypes, nativeCallConv, nativeCharSet)" />
<MemberSignature Language="C++ CLI" Value="public:
 System::Reflection::Emit::MethodBuilder ^ DefinePInvokeMethod(System::String ^ name, System::String ^ dllName, System::Reflection::MethodAttributes attributes, System::Reflection::CallingConventions callingConvention, Type ^ returnType, cli::array <Type ^> ^ parameterTypes, System::Runtime::InteropServices::CallingConvention nativeCallConv, System::Runtime::InteropServices::CharSet nativeCharSet);" />
<MemberType>Method</MemberType>