Freigeben über


Csc Class

Definition

Implements the Csc task. Use the Csc element in your project file to create and execute this task. For usage and parameter information, see Csc Task.

This API supports the product infrastructure and is not intended to be used directly from your code.

public ref class Csc : Microsoft::Build::Tasks::ManagedCompiler
public class Csc : Microsoft.Build.Tasks.ManagedCompiler
type Csc = class
    inherit ManagedCompiler
Public Class Csc
Inherits ManagedCompiler
Inheritance

Constructors

Csc()

This API supports the product infrastructure and is not intended to be used directly from your code.

Initializes a new instance of the Csc class.

Properties

AdditionalLibPaths

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the additional folders in which to look for assemblies.

(Inherited from ManagedCompiler)
AddModules

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the modules for the compiler to make available to the project you are currently compiling.

(Inherited from ManagedCompiler)
AllowUnsafeBlocks

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a Boolean value that indicates whether to compile code that uses the unsafe keyword.

ApplicationConfiguration

This API supports the product infrastructure and is not intended to be used directly from your code.

Returns configuration information.

Bag

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets the collection of parameters used by the derived task class.

(Inherited from ToolTaskExtension)
BaseAddress

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the preferred base address at which to load a DLL.

BuildEngine

The build engine automatically sets this property to allow tasks to call back into it.

(Inherited from Task)
BuildEngine2

The build engine automatically sets this property to allow tasks to call back into it. This is a convenience property so that task authors inheriting from this class do not have to cast the value from IBuildEngine to IBuildEngine2.

(Inherited from Task)
BuildEngine3

Retrieves the IBuildEngine3 version of the build engine interface provided by the host.

(Inherited from Task)
BuildEngine4

Retrieves the IBuildEngine4 version of the build engine interface provided by the host.

(Inherited from Task)
BuildEngine5

Retrieves the IBuildEngine5 version of the build engine interface provided by the host.

(Inherited from Task)
BuildEngine6

Retrieves the IBuildEngine6 version of the build engine interface provided by the host.

(Inherited from Task)
BuildEngine7

Retrieves the IBuildEngine7 version of the build engine interface provided by the host.

(Inherited from Task)
BuildEngine8

Retrieves the IBuildEngine8 version of the build engine interface provided by the host.

(Inherited from Task)
BuildEngine9

Retrieves the IBuildEngine9 version of the build engine interface provided by the host.

(Inherited from Task)
canBeIncremental

ToolTask is not incremental by default. When a derived class overrides SkipTaskExecution, then Question feature can take into effect.

(Inherited from ToolTask)
CheckForOverflowUnderflow

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a value that indicates whether the Csc task should cause an exception at run time for integer arithmetic that overflows the bounds of the data type.

CodePage

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the code page to use for all source code files in the compilation.

(Inherited from ManagedCompiler)
DebugType

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the debug type.

(Inherited from ManagedCompiler)
DefineConstants

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the conditional compiler constants.

(Inherited from ManagedCompiler)
DelaySign

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a value indicating whether the public key is placed in the assembly.

(Inherited from ManagedCompiler)
DisabledWarnings

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the list of warnings to be disabled.

DocumentationFile

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the XML file to hold the documentation comments.

EchoOff

When set to true, it passes /Q to the cmd.exe command line such that the command line does not get echo-ed on stdout

(Inherited from ToolTask)
EmitDebugInformation

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a value indicating whether the compiler generates debugging information.

(Inherited from ManagedCompiler)
EnvironmentOverride
Obsolete.

Gets the Path override value.

(Inherited from ToolTask)
EnvironmentVariables

Array of equals-separated pairs of environment variables that should be passed to the spawned executable, in addition to (or selectively overriding) the regular environment block.

(Inherited from ToolTask)
ErrorEndLocation

This API supports the product infrastructure and is not intended to be used directly from your code.

If true, outputs the line and column of the end location of each error.

ErrorReport

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the method to report a C# internal compiler error to Microsoft.

ExitCode

The return code of the spawned process. If the task logged any errors, but the process had an exit code of 0 (success), this will be set to -1.

(Inherited from ToolTask)
FailIfNotIncremental (Inherited from ToolTask)
FileAlignment

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a value indicating where to align the sections of the output file.

(Inherited from ManagedCompiler)
GenerateFullPaths

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a Boolean value that indicates whether to generate the absolute path to the file in the compiler output (true) or to generate the name of the file in the compiler output (false).

HasLoggedErrors

This API supports the product infrastructure and is not intended to be used directly from your code.

Whether this ToolTaskExtension has logged any errors

(Inherited from ToolTaskExtension)
HelpKeywordPrefix

Gets or sets the prefix used to compose help keywords from string resource names. If a task does not have help keywords associated with its messages, it can ignore this property or set it to null. If the prefix is set to an empty string, then string resource names will be used verbatim as help keywords. For an example of how this prefix is used, see the TaskLoggingHelper.LogErrorWithCodeFromResources(string, object[]) method.

(Inherited from Task)
HighEntropyVA

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the HighEntropyVA attribute.

(Inherited from ManagedCompiler)
HostCompilerSupportsAllParameters

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a value indicating whether the host compiler supports all task parameters.

(Inherited from ManagedCompiler)
HostObject

The build engine sets this property if the host IDE has associated a host object with this particular task.

(Inherited from Task)
KeyContainer

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the name of the cryptographic key container.

(Inherited from ManagedCompiler)
KeyFile

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the file name containing the cryptographic key.

(Inherited from ManagedCompiler)
LangVersion

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the version of the language to use.

LinkResources

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the .NET Framework resource files to link to the output file.

(Inherited from ManagedCompiler)
Log

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets an instance of a TaskLoggingHelperExtension class containing task logging methods.

(Inherited from ToolTaskExtension)
LogStandardErrorAsError

Should ALL messages received on the standard error stream be logged as errors.

(Inherited from ToolTask)
MainEntryPoint

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the class or module that contains the main entry point.

(Inherited from ManagedCompiler)
ModuleAssemblyName

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets an assembly whose non-public types a .netmodule can access.

NoConfig

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a value indicating whether the compiler should use the default response file.

(Inherited from ManagedCompiler)
NoLogo

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a value indicating whether to suppress the compiler banner information.

(Inherited from ManagedCompiler)
NoStandardLib

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a Boolean value that indicates whether the Csc task should prevent the import of mscorlib.dll, which defines the entire System namespace.

NoWin32Manifest

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a Boolean value that specifies whether an external UAC manifest is generated for the application.

(Inherited from ManagedCompiler)
Optimize

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a value indicating whether to enable compiler optimizations.

(Inherited from ManagedCompiler)
OutputAssembly

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the name of the output file.

(Inherited from ManagedCompiler)
PdbFile

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the path of the .pdb file.

Platform

Gets or sets the processor platform to be targeted by the output file.

Platform

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the Platform attribute.

(Inherited from ManagedCompiler)
Prefer32Bit

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the Prefer32Bit attribute.

(Inherited from ManagedCompiler)
PreferredUILang

This API supports the product infrastructure and is not intended to be used directly from your code.

The name of the language passed to the "/preferreduilang" compiler option.

References

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the items from which the compiler will import public type information.

(Inherited from ManagedCompiler)
Resources

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the .NET Framework resources to embed in the output file.

(Inherited from ManagedCompiler)
ResponseFileEncoding

Overridable property specifying the encoding of the response file, UTF8 by default

(Inherited from ToolTask)
ResponseFiles

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the response files that contain commands for the task.

(Inherited from ManagedCompiler)
Sources

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the source files to compile.

(Inherited from ManagedCompiler)
StandardErrorEncoding

Overridable property specifying the encoding of the captured task standard error stream

(Inherited from ToolTask)
StandardErrorImportance

Task Parameter: Importance with which to log text from the standard error stream.

(Inherited from ToolTask)
StandardErrorImportanceToUse

The actual importance at which standard error messages will be logged.

(Inherited from ToolTask)
StandardErrorLoggingImportance

Importance with which to log text from the standard error stream.

(Inherited from ToolTask)
StandardOutputEncoding

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the encoding of the captured task standard output stream.

(Inherited from ManagedCompiler)
StandardOutputImportance

Task Parameter: Importance with which to log text from the standard out stream.

(Inherited from ToolTask)
StandardOutputImportanceToUse

The actual importance at which standard out messages will be logged.

(Inherited from ToolTask)
StandardOutputLoggingImportance

Importance with which to log text from in the standard out stream.

(Inherited from ToolTask)
SubsystemVersion

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the SubsystemVersion attribute value.

(Inherited from ManagedCompiler)
TargetType

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the file format of the output file.

(Inherited from ManagedCompiler)
TaskProcessTerminationTimeout

A timeout to wait for a task to terminate before killing it. In milliseconds.

(Inherited from ToolTask)
TaskResources

Gets or sets the task's culture-specific resources. Derived classes should register their resources either during construction, or via this property, if they have localized strings.

(Inherited from Task)
Timeout

Project visible property that allows the user to specify an amount of time after which the task executable is terminated.

(Inherited from ToolTask)
ToolCanceled

Used to signal when a tool has been cancelled.

(Inherited from ToolTask)
ToolExe

Projects may set this to override a task's ToolName. Tasks may override this to prevent that.

(Inherited from ToolTask)
ToolName

This API supports the product infrastructure and is not intended to be used directly from your code.

Returns the name of the Csc tool (csc.exe).

ToolPath

Project-visible property allows the user to override the path to the executable.

(Inherited from ToolTask)
TreatWarningsAsErrors

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a value indicating whether warnings are treated as errors.

(Inherited from ManagedCompiler)
UseCommandProcessor

When set to true, the tool task will create a batch file for the command-line and execute that using the command-processor, rather than executing the command directly.

(Inherited from ToolTask)
UsedCommandLineTool

This API supports the product infrastructure and is not intended to be used directly from your code.

Whether the command line compiler was invoked, instead of the host object compiler.

(Inherited from ManagedCompiler)
UseHostCompilerIfAvailable

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a Boolean value that indicates whether the Csc task should use the in-process compiler object, if available.

UseNewLineSeparatorInResponseFile

When set to true, the response file will use new lines instead of spaces to separate arguments.

(Inherited from ToolTaskExtension)
UseUtf8Encoding

Whether or not to use UTF8 encoding for the cmd file and console window. Values: Always, Never, Detect If set to Detect, the current code page will be used unless it cannot represent the Command string. In that case, UTF-8 is used.

(Inherited from ToolTask)
Utf8Output

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a value indicating whether compiler output is logged using UTF-8 encoding.

(Inherited from ManagedCompiler)
WarningLevel

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the warning level for the compiler to display.

WarningsAsErrors

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a list of warnings to treat as errors.

WarningsNotAsErrors

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a list of warnings that are not treated as errors.

Win32Icon

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the icon file name.

(Inherited from ManagedCompiler)
Win32Manifest

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the Win32 manifest.

(Inherited from ManagedCompiler)
Win32Resource

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets a Win32 resource (.res) file to insert in the output file.

(Inherited from ManagedCompiler)
YieldDuringToolExecution

When set to true, this task will yield the node when its task is executing.

(Inherited from ToolTask)

Methods

AddCommandLineCommands(CommandLineBuilderExtension)

This API supports the product infrastructure and is not intended to be used directly from your code.

Generates command line arguments that the command line tool must run directly from the command line and not from a response file.

(Inherited from ManagedCompiler)
AddResponseFileCommands(CommandLineBuilderExtension)

This API supports the product infrastructure and is not intended to be used directly from your code.

Fills the specified commandLine parameter with switches and other information that can go into a response file.

AdjustCommandsForOperatingSystem(String)

Replace backslashes with OS-specific path separators, except when likely that the backslash is intentional.

(Inherited from ToolTask)
CallHostObjectToExecute()

This API supports the product infrastructure and is not intended to be used directly from your code.

Compiles the project through the host object.

Cancel()

Cancels the process executing the task by asking it to close nicely, then after a short period, forcing termination.

(Inherited from ToolTask)
CheckAllReferencesExistOnDisk()

This API supports the product infrastructure and is not intended to be used directly from your code.

Verifies that all specified references exist on disk.

(Inherited from ManagedCompiler)
CheckHostObjectSupport(String, Boolean)

This API supports the product infrastructure and is not intended to be used directly from your code.

Logs a message if the specified parameter is not supported by the host compiler.

(Inherited from ManagedCompiler)
DeleteTempFile(String)

Delete temporary file. If the delete fails for some reason (e.g. file locked by anti-virus) then the call will not throw an exception. Instead a warning will be logged, but the build will not fail.

(Inherited from ToolTask)
Execute()

This method invokes the tool with the given parameters.

(Inherited from ToolTask)
ExecuteTool(String, String, String)

Writes out a temporary response file and shell-executes the tool requested. Enables concurrent logging of the output of the tool.

(Inherited from ToolTask)
GenerateCommandLineCommands()

This API supports the product infrastructure and is not intended to be used directly from your code.

Returns a string with those switches and other information that can't go into a response file and must go directly onto the command line. Called after ValidateParameters and SkipTaskExecution

(Inherited from ToolTaskExtension)
GenerateFullPathToTool()

This API supports the product infrastructure and is not intended to be used directly from your code.

Returns the full file path of the Csc tool.

GenerateResponseFileCommands()

This API supports the product infrastructure and is not intended to be used directly from your code.

Returns the command line switch used by the tool executable to specify the response file Will only be called if the task returned a non empty string from GetResponseFileCommands Called after ValidateParameters, SkipTaskExecution and GetResponseFileCommands

(Inherited from ToolTaskExtension)
GetBoolParameterWithDefault(String, Boolean)

This API supports the product infrastructure and is not intended to be used directly from your code.

Get a bool parameter and return a default if its not present in the hash table.

(Inherited from ToolTaskExtension)
GetIntParameterWithDefault(String, Int32)

This API supports the product infrastructure and is not intended to be used directly from your code.

Get an int parameter and return a default if its not present in the hash table.

(Inherited from ToolTaskExtension)
GetProcessStartInfo(String, String, String)

Initializes the information required to spawn the process executing the tool.

(Inherited from ToolTask)
GetResponseFileSwitch(String)

Returns the command line switch used by the tool executable to specify the response file. Will only be called if the task returned a non empty string from GetResponseFileCommands Called after ValidateParameters, SkipTaskExecution and GetResponseFileCommands

(Inherited from ToolTask)
GetWorkingDirectory()

Gets the working directory to use for the process. Should return null if ToolTask should use the current directory.

(Inherited from ToolTask)
HandleTaskExecutionErrors()

This API supports the product infrastructure and is not intended to be used directly from your code.

Handles the return code from the compiler.

(Inherited from ManagedCompiler)
InitializeHostObject()

This API supports the product infrastructure and is not intended to be used directly from your code.

Returns a host object initialization status value that indicates what the next action should be.

ListHasNoDuplicateItems(ITaskItem[], String)

This API supports the product infrastructure and is not intended to be used directly from your code.

Determines if any duplicate items exist in the specified task parameter.

(Inherited from ManagedCompiler)
LogEventsFromTextOutput(String, MessageImportance)

Calls a method on the TaskLoggingHelper to parse a single line of text to see if there are any errors or warnings in canonical format. This can be overridden by the derived class if necessary.

(Inherited from ToolTask)
LogPathToTool(String, String)

Logs the tool name and the path from where it is being run.

(Inherited from ToolTask)
LogToolCommand(String)

Logs the actual command line about to be executed (or what the task wants the log to show)

(Inherited from ToolTask)
ProcessStarted()

Overridable function called after Start() in ExecuteTool(String, String, String)

(Inherited from ToolTask)
ReceiveExitNotification(Object, EventArgs)

Signals when the tool exits. The Process object executing the tool calls this method when the tool exits.

(Inherited from ToolTask)
ReceiveStandardErrorData(Object, DataReceivedEventArgs)

Queues up the output from the stderr stream of the process executing the tool, and signals the availability of the data. The Process object executing the tool calls this method for every line of text that the tool writes to stderr.

(Inherited from ToolTask)
ReceiveStandardOutputData(Object, DataReceivedEventArgs)

Queues up the output from the stdout stream of the process executing the tool, and signals the availability of the data. The Process object executing the tool calls this method for every line of text that the tool writes to stdout.

(Inherited from ToolTask)
ResponseFileEscape(String)

Overridable method to escape content of the response file

(Inherited from ToolTask)
SkipTaskExecution()

Returns true if task execution is not necessary. Executed after ValidateParameters

(Inherited from ToolTask)
StartToolProcess(Process)

We expect tasks to override this method if they need information about the tool process or its process events during task execution. Implementation should make sure that the task is started in this method. Starts the process during task execution.

(Inherited from ToolTask)
UseAlternateCommandLineToolToExecute()

This API supports the product infrastructure and is not intended to be used directly from your code.

If an alternate tool name or tool path was specified in the project file, then that tool is used rather than the host compiler for integrated development environment (IDE) builds.

(Inherited from ManagedCompiler)
ValidateParameters()

This API supports the product infrastructure and is not intended to be used directly from your code.

Validates the task parameters.

(Inherited from ManagedCompiler)

Applies to