本文整理汇总了C#中CSharpParseOptions.WithKind方法的典型用法代码示例。如果您正苦于以下问题:C# CSharpParseOptions.WithKind方法的具体用法?C# CSharpParseOptions.WithKind怎么用?C# CSharpParseOptions.WithKind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSharpParseOptions
的用法示例。
在下文中一共展示了CSharpParseOptions.WithKind方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
//.........这里部分代码省略.........
ImmutableArray<string> referencePaths = BuildSearchPaths(sdkDirectory, libPaths);
ValidateWin32Settings(win32ResourceFile, win32IconFile, win32ManifestFile, outputKind, diagnostics);
// Dev11 searches for the key file in the current directory and assembly output directory.
// We always look to base directory and then examine the search paths.
keyFileSearchPaths.Add(baseDirectory);
if (baseDirectory != outputDirectory)
{
keyFileSearchPaths.Add(outputDirectory);
}
if (!emitPdb)
{
if (pdbPath != null)
{
// Can't give a PDB file name and turn off debug information
AddDiagnostic(diagnostics, ErrorCode.ERR_MissingDebugSwitch);
}
}
string compilationName;
GetCompilationAndModuleNames(diagnostics, outputKind, sourceFiles, sourceFilesSpecified, moduleAssemblyName, ref outputFileName, ref moduleName, out compilationName);
var parseOptions = new CSharpParseOptions
(
languageVersion: languageVersion,
preprocessorSymbols: defines.ToImmutableAndFree(),
documentationMode: parseDocumentationComments ? DocumentationMode.Diagnose : DocumentationMode.None,
kind: SourceCodeKind.Regular,
features: CompilerOptionParseUtilities.ParseFeatures(features)
);
var scriptParseOptions = parseOptions.WithKind(SourceCodeKind.Script);
var options = new CSharpCompilationOptions
(
outputKind: outputKind,
moduleName: moduleName,
mainTypeName: mainTypeName,
scriptClassName: WellKnownMemberNames.DefaultScriptClassName,
usings: usings,
optimizationLevel: optimize ? OptimizationLevel.Release : OptimizationLevel.Debug,
checkOverflow: checkOverflow,
allowUnsafe: allowUnsafe,
concurrentBuild: concurrentBuild,
cryptoKeyContainer: keyContainerSetting,
cryptoKeyFile: keyFileSetting,
delaySign: delaySignSetting,
platform: platform,
generalDiagnosticOption: generalDiagnosticOption,
warningLevel: warningLevel,
specificDiagnosticOptions: diagnosticOptions
);
var emitOptions = new EmitOptions
(
metadataOnly: false,
debugInformationFormat: DebugInformationFormat.Pdb,
pdbFilePath: null, // to be determined later
outputNameOverride: null, // to be determined later
baseAddress: baseAddress,
highEntropyVirtualAddressSpace: highEntropyVA,
fileAlignment: fileAlignment,
subsystemVersion: subsystemVersion,
runtimeMetadataVersion: runtimeMetadataVersion