|
49 | 49 | ## Remarks
|
50 | 50 | A <xref:System.CodeDom.Compiler.CodeDomProvider> can be used to create and retrieve instances of code generators and code compilers. Code generators can be used to generate code in a particular language, and code compilers can be used to compile code into assemblies.
|
51 | 51 |
|
52 |
| -> [!NOTE] |
53 |
| -> In the .NET Framework 2.0, the methods made available in the code generator and code compiler are available directly from the code provider. You do not need to call <xref:System.CodeDom.Compiler.CodeDomProvider.CreateGenerator%2A> or <xref:System.CodeDom.Compiler.CodeDomProvider.CreateCompiler%2A> to access the methods, and those methods are marked as obsolete. This applies to preexisting as well as new code provider implementations. |
54 |
| -
|
55 | 52 | A <xref:System.CodeDom.Compiler.CodeDomProvider> implementation typically provides code generation and/or code compilation interfaces for generating code and managing compilation for a single programming language. Several languages are supported by <xref:System.CodeDom.Compiler.CodeDomProvider> implementations that ship with the Windows SDK. These languages include C#, Visual Basic, C++, and JScript. Developers or compiler vendors can implement the <xref:System.CodeDom.Compiler.ICodeGenerator> and <xref:System.CodeDom.Compiler.ICodeCompiler> interfaces and provide a <xref:System.CodeDom.Compiler.CodeDomProvider> that extends CodeDOM support to other programming languages.
|
56 | 53 |
|
57 | 54 | The [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) in the machine configuration file (Machine.config) provides a mechanism for developers and compiler vendors to add configuration settings for additional <xref:System.CodeDom.Compiler.CodeDomProvider> implementations.
|
|
74 | 71 | ]]></format>
|
75 | 72 | </remarks>
|
76 | 73 | <block subset="none" type="overrides">
|
77 |
| - <para>In the .NET Framework versions 1.0 and 1.1, code providers consist of implementations of <see cref="T:System.CodeDom.Compiler.CodeDomProvider" />, <see cref="T:System.CodeDom.Compiler.ICodeGenerator" />, <see cref="T:System.CodeDom.Compiler.ICodeParser" />, and <see cref="T:System.CodeDom.Compiler.ICodeCompiler" />. In the .NET Framework 2.0, the <see cref="M:System.CodeDom.Compiler.CodeDomProvider.CreateGenerator" />, <see cref="M:System.CodeDom.Compiler.CodeDomProvider.CreateParser" />, and <see cref="M:System.CodeDom.Compiler.CodeDomProvider.CreateCompiler" /> methods are obsolete, and the methods of <see cref="T:System.CodeDom.Compiler.ICodeGenerator" /> and <see cref="T:System.CodeDom.Compiler.ICodeCompiler" /> are directly available in the <see cref="T:System.CodeDom.Compiler.CodeDomProvider" /> class. You should override those methods in your code provider implementation and not call the base methods.</para> |
| 74 | + <para>In .NET Framework 1.0 and 1.1, code providers consist of implementations of <see cref="T:System.CodeDom.Compiler.CodeDomProvider" />, <see cref="T:System.CodeDom.Compiler.ICodeGenerator" />, <see cref="T:System.CodeDom.Compiler.ICodeParser" />, and <see cref="T:System.CodeDom.Compiler.ICodeCompiler" />. Starting in .NET Framework 2.0, the <see cref="M:System.CodeDom.Compiler.CodeDomProvider.CreateGenerator" />, <see cref="M:System.CodeDom.Compiler.CodeDomProvider.CreateParser" />, and <see cref="M:System.CodeDom.Compiler.CodeDomProvider.CreateCompiler" /> methods are obsolete, and the methods of <see cref="T:System.CodeDom.Compiler.ICodeGenerator" /> and <see cref="T:System.CodeDom.Compiler.ICodeCompiler" /> are directly available in the <see cref="T:System.CodeDom.Compiler.CodeDomProvider" /> class. You should override those methods in your code provider implementation and not call the base methods.</para> |
78 | 75 | </block>
|
79 | 76 | <altmember cref="T:System.CodeDom.Compiler.CompilerInfo" />
|
80 | 77 | <altmember cref="T:Microsoft.CSharp.CSharpCodeProvider" />
|
|
171 | 168 | > On .NET Core and .NET 5+, calls to the `CodeDomProvider.CompileAssemblyFromDom` method throw a <xref:System.PlatformNotSupportedException>. Compile code is not supported.
|
172 | 169 |
|
173 | 170 | > [!NOTE]
|
174 |
| -> In .NET Framework 2.0 and later versions, this method can be called directly on the code provider even if it's not overridden by the code provider. If the code provider does not override this method, the <xref:System.CodeDom.Compiler.ICodeCompiler> implementation is called by the base class. |
| 171 | +> In .NET Framework 2.0 and later versions, this method can be called directly on the code provider even if it's not overridden by the code provider. If the code provider does not override this method, the <xref:System.CodeDom.Compiler.ICodeCompiler> implementation is called by the base class. |
175 | 172 |
|
176 | 173 | ]]></format>
|
177 | 174 | </remarks>
|
|
361 | 358 | <format type="text/markdown"><![CDATA[
|
362 | 359 |
|
363 | 360 | ## Remarks
|
364 |
| - This method is obsolete in the .NET Framework 2.0. The recommended alternative is to call the <xref:System.CodeDom.Compiler.ICodeCompiler> methods that are directly available in the code provider. |
| 361 | + This method is obsolete. The recommended alternative is to call the <xref:System.CodeDom.Compiler.ICodeCompiler> methods that are directly available in the code provider. |
365 | 362 |
|
366 | 363 | ]]></format>
|
367 | 364 | </remarks>
|
368 | 365 | <block subset="none" type="overrides">
|
369 |
| - <para>In the .NET Framework 2.0, you should implement the <see cref="T:System.CodeDom.Compiler.ICodeCompiler" /> members in the <see cref="T:System.CodeDom.Compiler.CodeDomProvider" /> class and throw a <see cref="T:System.NotSupportedException" /> when this method is called.</para> |
| 366 | + <para>You should implement the <see cref="T:System.CodeDom.Compiler.ICodeCompiler" /> members in the <see cref="T:System.CodeDom.Compiler.CodeDomProvider" /> class and throw a <see cref="T:System.NotSupportedException" /> when this method is called.</para> |
370 | 367 | </block>
|
371 | 368 | </Docs>
|
372 | 369 | </Member>
|
|
476 | 473 | <format type="text/markdown"><![CDATA[
|
477 | 474 |
|
478 | 475 | ## Remarks
|
479 |
| - This method is obsolete in the .NET Framework 2.0. The recommended alternative is to call the <xref:System.CodeDom.Compiler.ICodeGenerator> methods that are directly available in the <xref:System.CodeDom.Compiler.CodeDomProvider> class. |
| 476 | + This method is obsolete. The recommended alternative is to call the <xref:System.CodeDom.Compiler.ICodeGenerator> methods that are directly available in the <xref:System.CodeDom.Compiler.CodeDomProvider> class. |
480 | 477 |
|
481 | 478 | ]]></format>
|
482 | 479 | </remarks>
|
483 | 480 | <block subset="none" type="overrides">
|
484 |
| - <para>In the .NET Framework 2.0, you should implement the <see cref="T:System.CodeDom.Compiler.ICodeGenerator" /> members in the <see cref="T:System.CodeDom.Compiler.CodeDomProvider" /> class and throw a <see cref="T:System.NotSupportedException" /> when this method is called.</para> |
| 481 | + <para>You should implement the <see cref="T:System.CodeDom.Compiler.ICodeGenerator" /> members in the <see cref="T:System.CodeDom.Compiler.CodeDomProvider" /> class and throw a <see cref="T:System.NotSupportedException" /> when this method is called.</para> |
485 | 482 | </block>
|
486 | 483 | </Docs>
|
487 | 484 | </Member>
|
|
533 | 530 | This method uses the specified <xref:System.IO.TextWriter> for output. This method supports more optimized code generation that incrementally updates the source code.
|
534 | 531 |
|
535 | 532 | > [!NOTE]
|
536 |
| -> The base class implementation calls the <xref:System.CodeDom.Compiler.CodeDomProvider.CreateGenerator%2A> method, which is obsolete in the .NET Framework 2.0 and results in a <xref:System.NotSupportedException> if an <xref:System.CodeDom.Compiler.ICodeGenerator> object is not returned. |
| 533 | +> The base class implementation calls the <xref:System.CodeDom.Compiler.CodeDomProvider.CreateGenerator%2A> method, which is obsolete and results in a <xref:System.NotSupportedException> if an <xref:System.CodeDom.Compiler.ICodeGenerator> object is not returned. |
537 | 534 |
|
538 | 535 | ]]></format>
|
539 | 536 | </remarks>
|
|
588 | 585 | This method uses the specified file name for output.
|
589 | 586 |
|
590 | 587 | > [!NOTE]
|
591 |
| -> The base class implementation calls the <xref:System.CodeDom.Compiler.CodeDomProvider.CreateGenerator%2A> method, which is obsolete in the .NET Framework 2.0 and results in a <xref:System.NotSupportedException> if an <xref:System.CodeDom.Compiler.ICodeGenerator> object is not returned. |
| 588 | +> The base class implementation calls the <xref:System.CodeDom.Compiler.CodeDomProvider.CreateGenerator%2A> method, which is obsolete and results in a <xref:System.NotSupportedException> if an <xref:System.CodeDom.Compiler.ICodeGenerator> object is not returned. |
592 | 589 |
|
593 | 590 | ]]></format>
|
594 | 591 | </remarks>
|
|
1287 | 1284 | ## Remarks
|
1288 | 1285 | Use the <xref:System.CodeDom.Compiler.CodeDomProvider.GetAllCompilerInfo%2A> method to enumerate the language provider settings on a computer.
|
1289 | 1286 |
|
1290 |
| -> [!NOTE] |
1291 |
| -> In the .NET Framework 2.0, the default language providers supplied by the .NET Framework are not specified in the [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) compiler configuration section and cannot be removed, so this method returns information about the default providers and any specified in the configuration file. |
1292 |
| -
|
1293 |
| -
|
1294 |
| -
|
1295 | 1287 | ## Examples
|
1296 | 1288 | The following code example enumerates the language providers on the computer and displays the configuration and compiler settings for each language provider. This code example is part of a larger example provided for the <xref:System.CodeDom.Compiler.CompilerInfo> class.
|
1297 | 1289 |
|
|
0 commit comments