212 instantiations of CSharpCompilationOptions
ConfigurationSchemaGenerator.Tests (1)
GeneratorTests.cs (1)
1562var compilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithNullableContextOptions(NullableContextOptions.Enable);
IdeCoreBenchmarks (1)
SwitchStatementBenchmarks.cs (1)
72solution = solution.WithProjectCompilationOptions(projectId, new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
InteractiveHost.UnitTests (1)
InteractiveHostDesktopTests.cs (1)
940new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
Microsoft.Analyzers.Extra.Tests (3)
Resources\RoslynTestUtils.cs (3)
59.WithCompilationOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary) 252proj = proj.WithCompilationOptions(new CSharpCompilationOptions(OutputKind.ConsoleApplication)); 319proj = proj.WithCompilationOptions(new CSharpCompilationOptions(OutputKind.ConsoleApplication));
Microsoft.Analyzers.Local.Tests (3)
Resources\RoslynTestUtils.cs (3)
59.WithCompilationOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary) 252proj = proj.WithCompilationOptions(new CSharpCompilationOptions(OutputKind.ConsoleApplication)); 320proj = proj.WithCompilationOptions(new CSharpCompilationOptions(OutputKind.ConsoleApplication));
Microsoft.AspNetCore.Analyzer.Testing (2)
CodeFixRunner.cs (1)
46var compilationOptions = ConfigureCompilationOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
DiagnosticVerifier.cs (1)
163.WithProjectCompilationOptions(projectId, new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
Microsoft.AspNetCore.Analyzers.Test (1)
src\Shared\AnalyzerTesting\TestCompilation.cs (1)
16new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
Microsoft.AspNetCore.App.Analyzers.Test (1)
Infrastructure\WellKnownTypesTests.cs (1)
76var options = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary);
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
314var compilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
314var compilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
CSharpCompiler.cs (1)
166var csharpCompilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (1)
CompilerFailedExceptionFactoryTest.cs (1)
50var compilation = CSharpCompilation.Create("Test", options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
Microsoft.CodeAnalysis.CSharp (37)
CommandLine\CSharpCommandLineParser.cs (1)
1485var options = new CSharpCompilationOptions
Compilation\CSharpCompilation.cs (2)
344private static readonly CSharpCompilationOptions s_defaultOptions = new CSharpCompilationOptions(OutputKind.ConsoleApplication); 345private static readonly CSharpCompilationOptions s_defaultSubmissionOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithReferencesSupersedeLowerVersions(true);
CSharpCompilationOptions.cs (34)
271return (flags == TopLevelBinderFlags) ? this : new CSharpCompilationOptions(this) { TopLevelBinderFlags = flags }; 285return new CSharpCompilationOptions(this) { OutputKind = kind }; 295return new CSharpCompilationOptions(this) { ModuleName = moduleName }; 305return new CSharpCompilationOptions(this) { ScriptClassName = name }; 315return new CSharpCompilationOptions(this) { MainTypeName = name }; 325return new CSharpCompilationOptions(this) { CryptoKeyContainer = name }; 340return new CSharpCompilationOptions(this) { CryptoKeyFile = path }; 355return new CSharpCompilationOptions(this) { CryptoPublicKey = value }; 365return new CSharpCompilationOptions(this) { DelaySign = value }; 375return new CSharpCompilationOptions(this) { Usings = usings }; 379new CSharpCompilationOptions(this) { Usings = usings.AsImmutableOrEmpty() }; 390return new CSharpCompilationOptions(this) { OptimizationLevel = value }; 400return new CSharpCompilationOptions(this) { CheckOverflow = enabled }; 410return new CSharpCompilationOptions(this) { NullableContextOptions = options }; 420return new CSharpCompilationOptions(this) { AllowUnsafe = enabled }; 430return new CSharpCompilationOptions(this) { Platform = platform }; 440return new CSharpCompilationOptions(this) { PublicSign = publicSign }; 461return new CSharpCompilationOptions(this) { GeneralDiagnosticOption = value }; 476return new CSharpCompilationOptions(this) { SpecificDiagnosticOptions = values }; 480new CSharpCompilationOptions(this) { SpecificDiagnosticOptions = values.ToImmutableDictionaryOrEmpty() }; 489return new CSharpCompilationOptions(this) { ReportSuppressedDiagnostics = reportSuppressedDiagnostics }; 499return new CSharpCompilationOptions(this) { WarningLevel = warningLevel }; 509return new CSharpCompilationOptions(this) { ConcurrentBuild = concurrentBuild }; 519return new CSharpCompilationOptions(this) { Deterministic = deterministic }; 529return new CSharpCompilationOptions(this) { CurrentLocalTime = value }; 539return new CSharpCompilationOptions(this) { DebugPlusMode = debugPlusMode }; 549return new CSharpCompilationOptions(this) { MetadataImportOptions = value }; 559return new CSharpCompilationOptions(this) { ReferencesSupersedeLowerVersions = value }; 569return new CSharpCompilationOptions(this) { XmlReferenceResolver = resolver }; 579return new CSharpCompilationOptions(this) { SourceReferenceResolver = resolver }; 589return new CSharpCompilationOptions(this) { SyntaxTreeOptionsProvider = provider }; 599return new CSharpCompilationOptions(this) { MetadataReferenceResolver = resolver }; 611return new CSharpCompilationOptions(this) { AssemblyIdentityComparer = comparer }; 621return new CSharpCompilationOptions(this) { StrongNameProvider = provider };
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (5)
src\Analyzers\CSharp\Tests\ImplementAbstractClass\ImplementAbstractClassTests.cs (1)
178compilationOptions: new CSharpCompilationOptions
src\Analyzers\CSharp\Tests\MakeMethodAsynchronous\MakeMethodAsynchronousTests.cs (2)
93compilationOptions: new CSharpCompilationOptions(OutputKind.ConsoleApplication)); 96await TestActionCountAsync(initial, count: 1, new TestParameters(compilationOptions: new CSharpCompilationOptions(OutputKind.ConsoleApplication)));
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryExpressionParenthesesTests.cs (1)
3225compilationOptions: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, checkOverflow: true)));
src\Analyzers\CSharp\Tests\UpdateProjectToAllowUnsafe\UpdateProjectToAllowUnsafeTests.cs (1)
44new CSharpCompilationOptions(outputKind: default, allowUnsafe: true)));
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (1)
CommandLineTests.cs (1)
2560Assert.Equal(new CSharpCompilationOptions(OutputKind.ConsoleApplication).OptimizationLevel, parsedArgs.CompilationOptions.OptimizationLevel);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
Interactive\CSharpInteractiveEvaluatorLanguageInfoProvider.cs (1)
37new CSharpCompilationOptions(
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (7)
Completion\CompletionProviders\CrefCompletionProviderTests.cs (1)
444using var workspace = EditorTestWorkspace.Create(LanguageNames.CSharp, new CSharpCompilationOptions(OutputKind.ConsoleApplication), new CSharpParseOptions(), [text], composition: GetComposition());
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (1)
3058using var workspace = EditorTestWorkspace.Create(LanguageNames.CSharp, new CSharpCompilationOptions(OutputKind.ConsoleApplication), new CSharpParseOptions(), [text], composition: GetComposition());
GenerateConstructorFromMembers\GenerateConstructorFromMembersTests.cs (2)
1999""", compilationOptions: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, allowUnsafe: true)); 2022""", compilationOptions: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, allowUnsafe: true));
QuickInfo\SemanticQuickInfoSourceTests.cs (1)
8187await TestWithOptionsAsync(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, nullableContextOptions: NullableContextOptions.Enable),
SymbolKey\SymbolKeyErrorTypeTests.cs (2)
373var sourceCompilation = (Compilation)CreateCompilation(source, options: new(OutputKind.DynamicallyLinkedLibrary, allowUnsafe: true)); 387var emptyCompilation = CSharpCompilation.Create("empty", options: new(OutputKind.DynamicallyLinkedLibrary, concurrentBuild: false))
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
Emit\DeterministicTests.cs (1)
472var opt = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Diagnostics\DiagnosticAnalyzerTests.cs (1)
1283var options = new CSharpCompilationOptions(OutputKind.ConsoleApplication, generalDiagnosticOption: generalOption, specificDiagnosticOptions: specificOptions);
Microsoft.CodeAnalysis.CSharp.Features (1)
SemanticSearch\CSharpSemanticSearchUtilities.cs (1)
12public static readonly CSharpCompilationOptions CompilationOptions = new(OutputKind.ConsoleApplication);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (7)
ExtractClass\ExtractClassTests.cs (1)
50var unusedCompilationOptions = new CSharpCompilationOptions(OutputKind.NetModule);
SimplifyTypeNames\SimplifyTypeNamesTests.cs (1)
5308""", compilationOptions: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, warningLevel: warningLevel));
src\Analyzers\CSharp\Tests\ImplementAbstractClass\ImplementAbstractClassTests.cs (1)
178compilationOptions: new CSharpCompilationOptions
src\Analyzers\CSharp\Tests\MakeMethodAsynchronous\MakeMethodAsynchronousTests.cs (2)
93compilationOptions: new CSharpCompilationOptions(OutputKind.ConsoleApplication)); 96await TestActionCountAsync(initial, count: 1, new TestParameters(compilationOptions: new CSharpCompilationOptions(OutputKind.ConsoleApplication)));
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryExpressionParenthesesTests.cs (1)
3225compilationOptions: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, checkOverflow: true)));
src\Analyzers\CSharp\Tests\UpdateProjectToAllowUnsafe\UpdateProjectToAllowUnsafeTests.cs (1)
44new CSharpCompilationOptions(outputKind: default, allowUnsafe: true)));
Microsoft.CodeAnalysis.CSharp.Scripting (1)
CSharpScriptCompiler.cs (1)
56WithTopLevelBinderFlags(new CSharpCompilationOptions(
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (4)
InteractiveSessionReferencesTests.cs (4)
35new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, cryptoPublicKey: TestResources.TestKeys.PublicKey_ce65828c82a341f2); 38new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, cryptoPublicKey: TestResources.TestKeys.PublicKey_ce65828c82a341f2); 530new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); 1118new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (4)
Semantics\InterpolationTests.cs (4)
1159var compOptions = new CSharpCompilationOptions(OutputKind.ConsoleApplication); 1262var compOptions = new CSharpCompilationOptions(OutputKind.ConsoleApplication); 1370var compOptions = new CSharpCompilationOptions(OutputKind.ConsoleApplication); 1422var compOptions = new CSharpCompilationOptions(OutputKind.ConsoleApplication);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (54)
Compilation\CSharpCompilationOptionsTests.cs (54)
38TestPropertyGeneric(new CSharpCompilationOptions(OutputKind.ConsoleApplication), factory, getter, validNonDefaultValue); 103TestPropertyGeneric(new CSharpCompilationOptions(OutputKind.ConsoleApplication), factory, getter, validNonDefaultValue); 147new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithScriptClassName(null).VerifyErrors( 151new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithScriptClassName("blah\0goo").VerifyErrors( 155new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithScriptClassName("").VerifyErrors( 159Assert.Equal(0, new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithMainTypeName(null).Errors.Length); 160new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithMainTypeName("blah\0goo").VerifyErrors( 164new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithMainTypeName("").VerifyErrors( 168new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithOutputKind((OutputKind)Int32.MaxValue).VerifyErrors( 172new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithOutputKind((OutputKind)Int32.MinValue).VerifyErrors( 176new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithOptimizationLevel((OptimizationLevel)Int32.MaxValue).VerifyErrors( 180new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithOptimizationLevel((OptimizationLevel)Int32.MinValue).VerifyErrors( 184new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithPlatform((Platform)Int32.MaxValue).VerifyErrors( 188new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithPlatform((Platform)Int32.MinValue).VerifyErrors( 192var defaultWarnings = new CSharpCompilationOptions(OutputKind.ConsoleApplication); 196Assert.Equal(ReportDiagnostic.Error, new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithGeneralDiagnosticOption(ReportDiagnostic.Error).GeneralDiagnosticOption); 197Assert.Equal(ReportDiagnostic.Default, new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithGeneralDiagnosticOption(ReportDiagnostic.Default).GeneralDiagnosticOption); 203var actual1 = new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithUsings(new[] { "A", "B" }).Usings; 206var actual2 = new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithUsings(Enumerable.Repeat("A", 1)).Usings; 209Assert.Equal(0, new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithUsings("A", "B").WithUsings(null).Usings.Count()); 210Assert.Equal(0, new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithUsings("A", "B").WithUsings((string[])null).Usings.Count()); 212new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithUsings(new string[] { null }).VerifyErrors( 216new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithUsings(new string[] { "" }).VerifyErrors( 220new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithUsings(new string[] { "blah\0goo" }).VerifyErrors( 235Assert.Equal(3, new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithSpecificDiagnosticOptions(warnings).SpecificDiagnosticOptions.Count); 237Assert.Equal(0, new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithSpecificDiagnosticOptions(null).SpecificDiagnosticOptions.Count); 239Assert.Equal(1, new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithWarningLevel(1).WarningLevel); 240new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithWarningLevel(-1).VerifyErrors( 244new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithWarningLevel(5).VerifyErrors(); 245new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithWarningLevel(int.MaxValue).VerifyErrors(); 287new CSharpCompilationOptions(OutputKind.ConsoleApplication, usings: new string[] { null }).VerifyErrors( 291new CSharpCompilationOptions(OutputKind.ConsoleApplication, usings: new string[] { "" }).VerifyErrors( 295new CSharpCompilationOptions(OutputKind.ConsoleApplication, usings: new string[] { "blah\0goo" }).VerifyErrors( 299Assert.Equal("Script", new CSharpCompilationOptions(OutputKind.ConsoleApplication, scriptClassName: null).ScriptClassName); 301new CSharpCompilationOptions(OutputKind.ConsoleApplication, scriptClassName: "blah\0goo").VerifyErrors( 305new CSharpCompilationOptions(OutputKind.ConsoleApplication, scriptClassName: "").VerifyErrors( 309Assert.Equal(0, new CSharpCompilationOptions(OutputKind.ConsoleApplication, mainTypeName: null).Errors.Length); 310new CSharpCompilationOptions(OutputKind.ConsoleApplication, mainTypeName: "blah\0goo").VerifyErrors( 314new CSharpCompilationOptions(OutputKind.ConsoleApplication, mainTypeName: "").VerifyErrors( 318new CSharpCompilationOptions(outputKind: (OutputKind)Int32.MaxValue).VerifyErrors( 322new CSharpCompilationOptions(outputKind: (OutputKind)Int32.MinValue).VerifyErrors( 326new CSharpCompilationOptions(OutputKind.ConsoleApplication, optimizationLevel: (OptimizationLevel)Int32.MaxValue).VerifyErrors( 330new CSharpCompilationOptions(OutputKind.ConsoleApplication, optimizationLevel: (OptimizationLevel)Int32.MinValue).VerifyErrors( 334new CSharpCompilationOptions(OutputKind.ConsoleApplication, platform: (Platform)Int32.MinValue).VerifyErrors( 338new CSharpCompilationOptions(OutputKind.ConsoleApplication, warningLevel: -1).VerifyErrors( 342new CSharpCompilationOptions(OutputKind.ConsoleApplication, warningLevel: 5).VerifyErrors(); 343new CSharpCompilationOptions(OutputKind.ConsoleApplication, warningLevel: int.MaxValue).VerifyErrors(); 345new CSharpCompilationOptions(OutputKind.ConsoleApplication, platform: Platform.AnyCpu32BitPreferred).VerifyErrors(); 347new CSharpCompilationOptions(OutputKind.WindowsRuntimeApplication, platform: Platform.AnyCpu32BitPreferred).VerifyErrors(); 349new CSharpCompilationOptions(OutputKind.WindowsRuntimeMetadata, platform: Platform.AnyCpu32BitPreferred).VerifyErrors( 352new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, platform: Platform.AnyCpu32BitPreferred).VerifyErrors( 442var options = new CSharpCompilationOptions(OutputKind.ConsoleApplication); 454Assert.Equal(NullableContextOptions.Disable, new CSharpCompilationOptions(OutputKind.ConsoleApplication).NullableContextOptions); 461options[i] = new CSharpCompilationOptions(OutputKind.ConsoleApplication, nullableContextOptions: values[i]);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
TestOptions.cs (1)
190=> new CSharpCompilationOptions(outputKind, optimizationLevel: optimizationLevel, warningLevel: Diagnostic.MaxWarningLevel, allowUnsafe: allowUnsafe);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
Workspace\LanguageServices\CSharpCompilationFactoryService.cs (2)
18private static readonly CSharpCompilationOptions s_defaultOptions = new(OutputKind.ConsoleApplication, concurrentBuild: false); 53return new CSharpCompilationOptions(outputKind: outputKind);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (3)
CodeGeneration\AddImportsTests.cs (2)
788.WithCompilationOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); 837.WithOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary))
CodeGeneration\SyntaxGeneratorTests.cs (1)
2549WithOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)).
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (7)
Diagnostics\SuppressMessageAttributeWorkspaceTests.cs (1)
49options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary),
MetadataAsSource\AbstractMetadataAsSourceTests.cs (1)
80.WithCompilationOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel: OptimizationLevel.Release));
MetadataAsSource\MetadataAsSourceTests.cs (1)
1927.WithCompilationOptions(new CS.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
Utilities\SymbolEquivalenceComparerTests.cs (4)
25public static readonly CS.CSharpCompilationOptions CSharpDllOptions = new CS.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary); 26public static readonly CS.CSharpCompilationOptions CSharpSignedDllOptions = new CS.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary). 1716using var workspace1 = TestWorkspace.CreateCSharp(csharpCode, compilationOptions: new CS.CSharpCompilationOptions(OutputKind.NetModule, moduleName: "GooModule")); 1717using var workspace2 = TestWorkspace.CreateCSharp(csharpCode, compilationOptions: new CS.CSharpCompilationOptions(OutputKind.NetModule, moduleName: "BarModule"));
Microsoft.CodeAnalysis.Rebuild.UnitTests (3)
CompilationOptionsReaderTests.cs (1)
59options: new CSharpCompilationOptions(outputKind: kind),
CSharpDeterministicKeyBuilderTests.cs (2)
25public static CSharpCompilationOptions Options { get; } = new CSharpCompilationOptions(OutputKind.ConsoleApplication, deterministic: true); 428options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, deterministic: true));
Microsoft.CodeAnalysis.Scripting.TestUtilities (2)
TestCompilationFactory.cs (2)
26new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); 44options ?? new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
Microsoft.CodeAnalysis.Test.Utilities (7)
AssemblyLoadTestFixture.cs (1)
523CSharpCompilationOptions options = new(OutputKind.DynamicallyLinkedLibrary, warningLevel: Diagnostic.MaxWarningLevel);
CommonTestBase.cs (1)
368compilationOptions = new CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary);
Compilation\CompilationExtensions.cs (1)
512options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
Mocks\Silverlight.cs (1)
81var options = new CSharpCompilationOptions(
Mocks\StdOle.cs (1)
68var options = new CSharpCompilationOptions(
Platform\Desktop\TestHelpers.cs (1)
91new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
TestBase.cs (1)
194var compilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary);
Microsoft.CodeAnalysis.UnitTests (5)
Analyzers\AnalyzerFileReferenceAppDomainTests.cs (1)
103new CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, warningLevel: CodeAnalysis.Diagnostic.MaxWarningLevel));
Analyzers\AnalyzerFileReferenceTests.cs (1)
487new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
CorLibTypesTests.cs (1)
69options: new CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, warningLevel: CodeAnalysis.Diagnostic.MaxWarningLevel),
Diagnostics\CompilationWithAnalyzersTests.cs (1)
23private static readonly CSharpCompilationOptions s_dllWithMaxWarningLevel = new(OutputKind.DynamicallyLinkedLibrary, warningLevel: CodeAnalysis.Diagnostic.MaxWarningLevel);
Diagnostics\SuppressMessageAttributeCompilerTests.cs (1)
59options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary),
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (20)
Attributes\AttributeTests_CallerArgumentExpression.vb (1)
193Dim csCompilation = CreateCSharpCompilation("Program2.Log(5 + 2);", referencedAssemblies:=TargetFrameworkUtil.GetReferences(TargetFramework.Net50, {compilation.EmitToImageReference()}), compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.ConsoleApplication))
Attributes\InternalsVisibleToAndStrongNameTests.vb (1)
840options:=New CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithStrongNameProvider(DefaultDesktopStrongNameProvider))
BreakingChanges.vb (1)
468compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.ConsoleApplication),
CodeGen\CodeGenAsyncTests.vb (1)
9086compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel:=OptimizationLevel.Release, allowUnsafe:=True))
CodeGen\CodeGenOverridingAndHiding.vb (4)
190compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary), 263compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary), 328compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary), 393compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary),
CodeGen\CodeGenTests.vb (1)
8168compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary))
CodeGen\CodeGenTuples.vb (5)
7205compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)) 7476compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)) 17349compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary), 21326compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary), 21462compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary),
CodeGen\CodeGenWithEvents.vb (3)
1691compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)) 1791compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)) 1893compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary))
Emit\DeterministicTests.vb (3)
174compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)) 195compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.NetModule), 238compilationOptions:=New CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary))
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestWorkspace_XmlConsumption.cs (1)
499? new CSharpCompilationOptions(OutputKind.WindowsRuntimeMetadata, allowUnsafe: allowUnsafe)
Microsoft.CodeAnalysis.Workspaces.UnitTests (9)
BatchFixAllProviderTests.cs (1)
151return new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary);
FindReferencesTests.cs (1)
280var prj = sln.GetProject(prj1Id).WithCompilationOptions(new CSharp.CSharpCompilationOptions(OutputKind.ConsoleApplication));
Host\LanguageServices\TestCSharpCompilationFactoryServiceWithIncrementalGeneratorTracking.cs (2)
20private static readonly CSharpCompilationOptions s_defaultOptions = new(OutputKind.ConsoleApplication, concurrentBuild: false); 55return new CSharpCompilationOptions(outputKind: outputKind);
SolutionTests\SolutionTests.cs (5)
1175compilationOptions: new CSharpCompilationOptions(OutputKind.WindowsApplication, moduleName: "newModuleName"), 1314compilationOptions: new CSharpCompilationOptions(OutputKind.WindowsApplication, moduleName: "newModuleName"), 1419compilationOptions: new CSharpCompilationOptions(OutputKind.WindowsApplication, moduleName: "newModuleName"), 1724var options = new CSharpCompilationOptions(OutputKind.NetModule); 4831.WithProjectCompilationOptions(projectId, new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithNullableContextOptions(NullableContextOptions.Enable));
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
84new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithNullableContextOptions(NullableContextOptions.Enable));
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
84new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithNullableContextOptions(NullableContextOptions.Enable));
Microsoft.Gen.Logging.Unit.Tests (2)
CompilationHelper.cs (1)
51options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
test\Generators\Shared\RoslynTestUtils.cs (1)
84new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithNullableContextOptions(NullableContextOptions.Enable));
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
84new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithNullableContextOptions(NullableContextOptions.Enable));
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
84new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithNullableContextOptions(NullableContextOptions.Enable));
Mvc.Analyzers.Test (1)
src\Shared\AnalyzerTesting\TestCompilation.cs (1)
16new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
StackDepthTest (1)
Program.cs (1)
78var options = new CSharpCompilationOptions(outputKind: OutputKind.DynamicallyLinkedLibrary, concurrentBuild: false);
System.Windows.Forms.Design.Tests (1)
System\Resources\Tools\CodeDomCompileHelper.cs (1)
38new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
System.Windows.Forms.PrivateSourceGenerators.Tests (1)
EnumValidationTests.cs (1)
303CSharpCompilation compilation = CSharpCompilation.Create("original", new SyntaxTree[] { syntaxTree }, references, new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
VBCSCompiler.UnitTests (1)
AnalyzerConsistencyCheckerTests.cs (1)
58var options = new CSharpCompilationOptions(
686 references to CSharpCompilationOptions
ConfigurationSchemaGenerator.Tests (1)
GeneratorTests.cs (1)
1562var compilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithNullableContextOptions(NullableContextOptions.Enable);
Microsoft.AspNetCore.App.Analyzers.Test (1)
Infrastructure\WellKnownTypesTests.cs (1)
76var options = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary);
Microsoft.AspNetCore.Http.Extensions.Tests (3)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (3)
311internal static Project CreateProject(Func<CSharpCompilationOptions, CSharpCompilationOptions> modifyCompilationOptions = null) 314var compilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)
Microsoft.AspNetCore.Http.Microbenchmarks (3)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (3)
311internal static Project CreateProject(Func<CSharpCompilationOptions, CSharpCompilationOptions> modifyCompilationOptions = null) 314var compilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (4)
CSharpCompiler.cs (4)
27private CSharpCompilationOptions? _compilationOptions; 46public virtual CSharpCompilationOptions CSharpCompilationOptions 162private static CSharpCompilationOptions GetCompilationOptions( 166var csharpCompilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (2)
CSharpCompilerTest.cs (2)
64var compilationOptions = compiler.CSharpCompilationOptions; 94var compilationOptions = compiler.CSharpCompilationOptions;
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (4)
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpCodeFixVerifier`2+Test.cs (2)
103var compilationOptions = (CSharpCompilationOptions)base.CreateCompilationOptions();
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpCodeRefactoringVerifier`1+Test.cs (2)
111var compilationOptions = (CSharpCompilationOptions)base.CreateCompilationOptions();
Microsoft.CodeAnalysis.CSharp (58)
CommandLine\CSharpCommandLineArguments.cs (1)
16public new CSharpCompilationOptions CompilationOptions { get; internal set; }
CommandLine\CSharpCommandLineParser.cs (1)
1485var options = new CSharpCompilationOptions
Compilation\CSharpCompilation.cs (12)
53private readonly CSharpCompilationOptions _options; 182public new CSharpCompilationOptions Options 344private static readonly CSharpCompilationOptions s_defaultOptions = new CSharpCompilationOptions(OutputKind.ConsoleApplication); 345private static readonly CSharpCompilationOptions s_defaultSubmissionOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithReferencesSupersedeLowerVersions(true); 360CSharpCompilationOptions? options = null) 380CSharpCompilationOptions? options = null, 401CSharpCompilationOptions options, 453CSharpCompilationOptions options, 470CSharpCompilationOptions options, 655public CSharpCompilation WithOptions(CSharpCompilationOptions options) 657var oldOptions = this.Options; 3961return this.WithOptions((CSharpCompilationOptions)options);
Compilation\CSharpDeterministicKeyBuilder.cs (1)
22if (options is not CSharpCompilationOptions csharpOptions)
CSharpCompilationOptions.cs (39)
22public sealed class CSharpCompilationOptions : CompilationOptions, IEquatable<CSharpCompilationOptions> 231private CSharpCompilationOptions(CSharpCompilationOptions other) : this( 269internal CSharpCompilationOptions WithTopLevelBinderFlags(BinderFlags flags) 278public new CSharpCompilationOptions WithOutputKind(OutputKind kind) 288public new CSharpCompilationOptions WithModuleName(string? moduleName) 298public new CSharpCompilationOptions WithScriptClassName(string? name) 308public new CSharpCompilationOptions WithMainTypeName(string? name) 318public new CSharpCompilationOptions WithCryptoKeyContainer(string? name) 328public new CSharpCompilationOptions WithCryptoKeyFile(string? path) 343public new CSharpCompilationOptions WithCryptoPublicKey(ImmutableArray<byte> value) 358public new CSharpCompilationOptions WithDelaySign(bool? value) 368public CSharpCompilationOptions WithUsings(ImmutableArray<string> usings) 378public CSharpCompilationOptions WithUsings(IEnumerable<string>? usings) => 381public CSharpCompilationOptions WithUsings(params string[]? usings) => WithUsings((IEnumerable<string>?)usings); 383public new CSharpCompilationOptions WithOptimizationLevel(OptimizationLevel value) 393public new CSharpCompilationOptions WithOverflowChecks(bool enabled) 403public CSharpCompilationOptions WithNullableContextOptions(NullableContextOptions options) 413public CSharpCompilationOptions WithAllowUnsafe(bool enabled) 423public new CSharpCompilationOptions WithPlatform(Platform platform) 433public new CSharpCompilationOptions WithPublicSign(bool publicSign) 454public new CSharpCompilationOptions WithGeneralDiagnosticOption(ReportDiagnostic value) 464public new CSharpCompilationOptions WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>? values) 479public new CSharpCompilationOptions WithSpecificDiagnosticOptions(IEnumerable<KeyValuePair<string, ReportDiagnostic>>? values) => 482public new CSharpCompilationOptions WithReportSuppressedDiagnostics(bool reportSuppressedDiagnostics) 492public CSharpCompilationOptions WithWarningLevel(int warningLevel) 502public new CSharpCompilationOptions WithConcurrentBuild(bool concurrentBuild) 512public new CSharpCompilationOptions WithDeterministic(bool deterministic) 522internal CSharpCompilationOptions WithCurrentLocalTime(DateTime value) 532internal CSharpCompilationOptions WithDebugPlusMode(bool debugPlusMode) 542public new CSharpCompilationOptions WithMetadataImportOptions(MetadataImportOptions value) 552internal CSharpCompilationOptions WithReferencesSupersedeLowerVersions(bool value) 562public new CSharpCompilationOptions WithXmlReferenceResolver(XmlReferenceResolver? resolver) 572public new CSharpCompilationOptions WithSourceReferenceResolver(SourceReferenceResolver? resolver) 582public new CSharpCompilationOptions WithSyntaxTreeOptionsProvider(SyntaxTreeOptionsProvider? provider) 592public new CSharpCompilationOptions WithMetadataReferenceResolver(MetadataReferenceResolver? resolver) 602public new CSharpCompilationOptions WithAssemblyIdentityComparer(AssemblyIdentityComparer? comparer) 614public new CSharpCompilationOptions WithStrongNameProvider(StrongNameProvider? provider) 730public bool Equals(CSharpCompilationOptions? other) 750return this.Equals(obj as CSharpCompilationOptions);
Errors\MessageProvider.cs (1)
131((CSharpCompilationOptions)options).NullableContextOptions,
Symbols\Source\SourceAssemblySymbol.cs (3)
647CSharpCompilationOptions compilationOptions = compilation.Options; 686CSharpCompilationOptions compilationOptions = compilation.Options; 1942CSharpCompilationOptions options = _compilation.Options;
Microsoft.CodeAnalysis.CSharp.CodeStyle (4)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (2)
43var compilationOptions = compilation.Options; 48CSharpCompilationOptions compilationOptions,
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (2)
105var compilationOptions = ((CSharpCompilationOptions)context.SemanticModel.Compilation.Options).NullableContextOptions; 329(defaultCompleted, options: ((CSharpCompilationOptions)semanticModel.Compilation.Options).NullableContextOptions, cancellationToken));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\UpdateProjectToAllowUnsafe\CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (2)
41var compilationOptions = (CSharpCompilationOptions?)project.CompilationOptions;
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (7)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryImports\RemoveUnnecessaryImportsTests.cs (2)
2064var compilationOptions = (CSharpCompilationOptions)solution.GetRequiredProject(projectId).CompilationOptions!;
src\Analyzers\CSharp\Tests\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveTests.cs (2)
485var compilationOptions = (CSharpCompilationOptions?)solution.GetRequiredProject(projectId).CompilationOptions;
src\Analyzers\CSharp\Tests\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveTests.cs (2)
240var compilationOptions = (CSharpCompilationOptions?)solution.GetRequiredProject(projectId).CompilationOptions;
src\Analyzers\CSharp\Tests\UpdateProjectToAllowUnsafe\UpdateProjectToAllowUnsafeTests.cs (1)
39Assert.True(((CSharpCompilationOptions)newSolution.Projects.Single().CompilationOptions!).AllowUnsafe);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
QuickInfo\SemanticQuickInfoSourceTests.cs (1)
39CSharpCompilationOptions options,
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (64)
CodeGen\CodeGenAsyncEHTests.cs (1)
26private CompilationVerifier CompileAndVerify(string source, string expectedOutput = null, IEnumerable<MetadataReference> references = null, CSharpCompilationOptions options = null)
CodeGen\CodeGenAsyncIteratorTests.cs (8)
140private CSharpCompilation CreateCompilationWithAsyncIterator(string source, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 144private CSharpCompilation CreateCompilationWithAsyncIterator(CSharpTestSource source, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 2646foreach (var options in new[] { TestOptions.DebugExe, TestOptions.ReleaseExe }) 7139foreach (var options in new[] { TestOptions.DebugExe, TestOptions.ReleaseExe }) 7272foreach (var options in new[] { TestOptions.DebugExe, TestOptions.ReleaseExe }) 7404foreach (var options in new[] { TestOptions.DebugExe, TestOptions.ReleaseExe }) 7553foreach (var options in new[] { TestOptions.DebugExe, TestOptions.ReleaseExe }) 7613foreach (var options in new[] { TestOptions.DebugExe, TestOptions.ReleaseExe })
CodeGen\CodeGenAsyncLocalsTests.cs (1)
27private CompilationVerifier CompileAndVerify(string source, string expectedOutput = null, IEnumerable<MetadataReference> references = null, CSharpCompilationOptions options = null, Verification verify = default)
CodeGen\CodeGenAsyncSpillTests.cs (2)
23private CompilationVerifier CompileAndVerify(string source, string expectedOutput = null, IEnumerable<MetadataReference> references = null, CSharpCompilationOptions options = null) 3787foreach (var options in new[] { TestOptions.DebugExe, TestOptions.ReleaseExe })
CodeGen\CodeGenAsyncTests.cs (2)
26private static CSharpCompilation CreateCompilation(string source, IEnumerable<MetadataReference> references = null, CSharpCompilationOptions options = null) 36private CompilationVerifier CompileAndVerify(string source, string expectedOutput, IEnumerable<MetadataReference> references = null, CSharpCompilationOptions options = null, Verification verify = default)
CodeGen\CodeGenConstructorInitTests.cs (1)
690var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All);
CodeGen\CodeGenExprLambdaTests.cs (1)
24CSharpCompilationOptions options = null,
CodeGen\CodeGenFunctionPointersTests.cs (4)
34CSharpCompilationOptions? options = null) 46private static CSharpCompilation CreateCompilationWithFunctionPointers(CSharpTestSource source, IEnumerable<MetadataReference>? references = null, CSharpCompilationOptions? options = null, TargetFramework? targetFramework = null) 51private static CSharpCompilation CreateCompilationWithFunctionPointers(CSharpTestSource source, bool includeUnmanagedCallersOnly, CSharpCompilationOptions? options = null) 65private static CSharpCompilation CreateCompilationWithFunctionPointersAndIl(string source, string ilStub, CSharpCompilationOptions? options = null, bool includeUnmanagedCallersOnly = true)
CodeGen\CodeGenLocalFunctionTests.cs (1)
6301internal CompilationVerifier VerifyOutput(string source, string output, CSharpCompilationOptions options, Verification verify = default)
CodeGen\CodeGenReadOnlySpanConstructionTest.cs (1)
762var compilationOptions = TestOptions.ReleaseExe;
CodeGen\CodeGenRefConditionalOperatorTests.cs (2)
1265void verify(CSharpCompilationOptions options, Verification verify, string expectedIL) 1352void verify(CSharpCompilationOptions options, string expectedIL)
CodeGen\CodeGenRefLocalTests.cs (5)
4239void verify(CSharpCompilationOptions options, Verification verify, string expectedIL) 4308void verify(CSharpCompilationOptions options, string expectedIL) 4373void verify(CSharpCompilationOptions options, Verification verify, string expectedIL) 4425void verify(CSharpCompilationOptions options, Verification verify, string expectedIL) 4481void verify(CSharpCompilationOptions options, Verification verify, string expectedIL)
CodeGen\CodeGenRefOutTests.cs (5)
540void verify(CSharpCompilationOptions options, string expectedIL) 627void verify(CSharpCompilationOptions options, string expectedIL) 689void verify(CSharpCompilationOptions options, string expectedIL) 775void verify(CSharpCompilationOptions options, string expectedIL) 827void verify(CSharpCompilationOptions options, string expectedIL)
CodeGen\CodeGenRefReturnTests.cs (1)
24CSharpCompilationOptions options = null,
CodeGen\CodeGenTests.cs (2)
34var options = TestOptions.ReleaseDll 13271var options = compilation.Options;
CodeGen\CodeGenTupleTest.cs (1)
23218var signedDllOptions = TestOptions.SigningReleaseDll.
CodeGen\GotoTest.cs (1)
1128var options = TestOptions.DebugDll.WithSourceReferenceResolver(resolver);
CodeGen\ITuplePatternTests.cs (1)
17protected CSharpCompilation CreatePatternCompilation(string source, CSharpCompilationOptions options = null)
CodeGen\PatternTests.cs (5)
3548foreach (var options in new[] { TestOptions.DebugExe, TestOptions.ReleaseExe }) 3631foreach (var options in new[] { TestOptions.DebugExe, TestOptions.ReleaseExe }) 3703foreach (var options in new[] { TestOptions.DebugExe, TestOptions.ReleaseExe }) 3779foreach (var options in new[] { TestOptions.DebugExe, TestOptions.ReleaseExe }) 4327foreach (var compilationOptions in new[] { TestOptions.ReleaseExe, TestOptions.DebugExe })
Emit\CompilationEmitTests.cs (10)
1904var options = TestOptions.DebugDll.WithDeterministic(false); 2014var signedDllOptions = TestOptions.SigningReleaseDll. 2032var signedDllOptions = TestOptions.SigningReleaseDll. 2052var signedDllOptions = TestOptions.SigningReleaseDll 5571var options = TestOptions.DebugDll.WithGeneralDiagnosticOption(ReportDiagnostic.Error); 5579var options = TestOptions.DebugDll.WithSpecificDiagnosticOptions("CS0169", ReportDiagnostic.Error); 5583private void TestWarnAsErrorDoesNotEmitCore(CSharpCompilationOptions options) 5616var options = TestOptions.DebugDll.WithGeneralDiagnosticOption(ReportDiagnostic.Error); 5624var options = TestOptions.DebugDll.WithSpecificDiagnosticOptions("CS0612", ReportDiagnostic.Error); 5628private void TestWarnAsErrorWithMetadataOnlyImageDoesEmitCore(CSharpCompilationOptions options)
Emit\CovariantReturnTests.cs (1)
236CSharpCompilationOptions options = null,
Emit\DesktopStrongNameProviderTests.cs (2)
95var options = TestOptions 112var options = TestOptions
Emit\DeterministicTests.cs (3)
34private Guid CompiledGuid(string source, string assemblyName, CSharpCompilationOptions options, EmitOptions emitOptions = null, Platform platform = Platform.AnyCpu) 53var options = (optimize ? TestOptions.ReleaseExe : TestOptions.DebugExe).WithPlatform(platform).WithDeterministic(true); 472var opt = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary);
Emit\DynamicAnalysis\DynamicInstrumentationTests.cs (2)
3641private CompilationVerifier CompileAndVerify(string source, string expectedOutput = null, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null, Verification verify = default) 3652private CompilationVerifier CompileAndVerify((string Path, string Content)[] sources, string expectedOutput = null, CSharpCompilationOptions options = null)
Emit\EmitMetadataTests.cs (1)
2222var options = TestOptions.ReleaseExe.WithPlatform(platform);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (17)
Emit\EditAndContinue\AssemblyReferencesTests.cs (2)
29private static readonly CSharpCompilationOptions s_signedDll = 583var options = ComSafeDebugDll.WithCryptoPublicKey(TestResources.TestKeys.PublicKey_ce65828c82a341f2);
Emit\EditAndContinue\EditAndContinueTest.cs (2)
19CSharpCompilationOptions? options = null, 27private readonly CSharpCompilationOptions _compilationOptions = (options ?? TestOptions.DebugDll).WithConcurrentBuild(false);
Emit\EditAndContinue\EditAndContinueTestBase.cs (1)
33internal static readonly CSharpCompilationOptions ComSafeDebugDll = TestOptions.DebugDll.WithConcurrentBuild(false);
Emit\EditAndContinue\EditAndContinueTests.cs (1)
8026var options = TestOptions.UnsafeDebugDll;
Emit\RuntimeProbing\ModuleCancellationTests.cs (1)
25private CompilationVerifier CompileAndVerify(string source, string? expectedOutput = null, CSharpCompilationOptions? options = null, Verification? verification = null)
Emit\RuntimeProbing\StackOverflowProbingTests.cs (1)
24private CompilationVerifier CompileAndVerify(string source, string? expectedOutput = null, CSharpCompilationOptions? options = null, Verification? verification = null)
PDB\CSharpDeterministicBuildCompilationTests.cs (8)
30CSharpCompilationOptions originalOptions, 56CSharpCompilationOptions compilationOptions, 97public void PortablePdb_DeterministicCompilation(CSharpCompilationOptions compilationOptions, EmitOptions emitOptions, CSharpParseOptions parseOptions) 157public void PortablePdb_DeterministicCompilation_DuplicateFilePaths(CSharpCompilationOptions compilationOptions, EmitOptions emitOptions, CSharpParseOptions parseOptions) 221public void PortablePdb_DeterministicCompilationWithSJIS(CSharpCompilationOptions compilationOptions, EmitOptions emitOptions, CSharpParseOptions parseOptions) 285foreach (var compilationOptions in GetCompilationOptions()) 297private static IEnumerable<CSharpCompilationOptions> GetCompilationOptions() 306var defaultOptions = new CSharpCompilationOptions(
PDB\CSharpPDBTestBase.cs (1)
20public static void TestSequencePoints(string markup, CSharpCompilationOptions compilationOptions, CSharpParseOptions parseOptions = null, string methodName = "")
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (129)
Attributes\AttributeTests.cs (15)
1701CSharpCompilationOptions opt = TestOptions.ReleaseDll; 3166CSharpCompilationOptions opt = TestOptions.ReleaseDll; 3208CSharpCompilationOptions opt = TestOptions.ReleaseDll; 3442CSharpCompilationOptions opt = TestOptions.ReleaseDll; 3581CSharpCompilationOptions opt = TestOptions.ReleaseDll; 3675CSharpCompilationOptions opt = TestOptions.ReleaseDll; 3782CSharpCompilationOptions opt = TestOptions.ReleaseDll; 5992CSharpCompilationOptions opt = TestOptions.ReleaseDll; 7490CSharpCompilationOptions opt = TestOptions.ReleaseDll; 7608CSharpCompilationOptions opt = TestOptions.ReleaseDll; 7651CSharpCompilationOptions opt = TestOptions.ReleaseDll; 7709CSharpCompilationOptions opt = TestOptions.ReleaseDll; 7807CSharpCompilationOptions opt = TestOptions.ReleaseDll; 7915CSharpCompilationOptions opt = TestOptions.ReleaseDll; 7953CSharpCompilationOptions opt = TestOptions.ReleaseDll;
Attributes\AttributeTests_IsByRefLike.cs (3)
356var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All); 452var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All); 606var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All);
Attributes\AttributeTests_IsUnmanaged.cs (2)
626var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All); 722var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All);
Attributes\AttributeTests_Nullable.cs (5)
526var options = TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.All); 561var options = TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.All); 3470var options = WithNullableEnable().WithMetadataImportOptions(MetadataImportOptions.All); 3515var options = WithNullableEnable(); 3631var options = TestOptions.ReleaseDll;
Attributes\AttributeTests_NullablePublicOnly.cs (16)
31var options = WithNullableEnable().WithMetadataImportOptions(MetadataImportOptions.All); 56var options = WithNullableEnable().WithMetadataImportOptions(MetadataImportOptions.All); 83var options = WithNullableEnable().WithMetadataImportOptions(MetadataImportOptions.All); 99var options = WithNullableEnable().WithMetadataImportOptions(MetadataImportOptions.All); 119var options = TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.All); 139var options = WithNullableEnable().WithMetadataImportOptions(MetadataImportOptions.All); 159var options = WithNullableEnable().WithMetadataImportOptions(MetadataImportOptions.All); 179var options = WithNullableDisable().WithMetadataImportOptions(MetadataImportOptions.All); 199var options = WithNullableDisable().WithMetadataImportOptions(MetadataImportOptions.All); 216var options = WithNullableDisable().WithMetadataImportOptions(MetadataImportOptions.All); 270var options = WithNullableDisable().WithMetadataImportOptions(MetadataImportOptions.All); 290var options = WithNullableDisable().WithMetadataImportOptions(MetadataImportOptions.All); 309var options = WithNullableDisable().WithMetadataImportOptions(MetadataImportOptions.All); 329var options = WithNullableDisable().WithMetadataImportOptions(MetadataImportOptions.All); 353var options = TestOptions.ReleaseExe.WithMetadataImportOptions(MetadataImportOptions.All); 376var options = TestOptions.ReleaseExe.WithMetadataImportOptions(MetadataImportOptions.All);
Attributes\AttributeTests_ReadOnlyStruct.cs (3)
346var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All); 444var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All); 598var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All);
Attributes\AttributeTests_RefReadOnly.cs (11)
594var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All); 622var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All); 648var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All); 682var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All); 721var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All); 753var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All); 780var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All); 815var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All); 1051var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All); 1169var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All); 1325var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All);
Attributes\AttributeTests_Synthesized.cs (34)
171var options = TestOptions.CreateTestOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel) 220var options = TestOptions.CreateTestOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel) 259var options = TestOptions.CreateTestOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel) 287var options = TestOptions.CreateTestOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel) 425var options = TestOptions.CreateTestOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel) 480var options = TestOptions.CreateTestOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel) 538var options = TestOptions.CreateTestOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel) 576var options = TestOptions.CreateTestOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel) 619var options = TestOptions.CreateTestOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel) 981var options = TestOptions.CreateTestOptions(outputKind, optimizationLevel); 1016var options = TestOptions.CreateTestOptions(outputKind, optimizationLevel); 1051var options = TestOptions.CreateTestOptions(outputKind, optimizationLevel); 1086var options = TestOptions.CreateTestOptions(outputKind, optimizationLevel); 1123var options = TestOptions.CreateTestOptions(outputKind, optimizationLevel); 1161var options = TestOptions.CreateTestOptions(outputKind, optimizationLevel); 1197var options = TestOptions.CreateTestOptions(outputKind, optimizationLevel); 1235var options = TestOptions.CreateTestOptions(outputKind, optimizationLevel); 1261var options = TestOptions.CreateTestOptions(outputKind, optimizationLevel); 1305var options = TestOptions.CreateTestOptions(outputKind, optimizationLevel); 1354var options = TestOptions.CreateTestOptions(outputKind, optimizationLevel); 1401var options = TestOptions.CreateTestOptions(outputKind, optimizationLevel); 1445var options = TestOptions.CreateTestOptions(outputKind, optimizationLevel); 1488var options = TestOptions.CreateTestOptions(outputKind, optimizationLevel); 1532var options = TestOptions.CreateTestOptions(outputKind, optimizationLevel); 1573var options = TestOptions.CreateTestOptions(outputKind, optimizationLevel); 1671var options = TestOptions.CreateTestOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel) 1714var options = TestOptions.CreateTestOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel) 1756var options = TestOptions.CreateTestOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel) 1798var referenceOptions = TestOptions.CreateTestOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel) 1802var options = TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.All); 1837var options = TestOptions.CreateTestOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel) 1867var options = TestOptions.CreateTestOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel) 1897var referenceOptions = TestOptions.CreateTestOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel) 1901var options = TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.All);
Attributes\AttributeTests_WellKnownAttributes.cs (4)
5271var opt = TestOptions.ReleaseDll; 8840void verify(CSharpCompilationOptions options, params DiagnosticDescription[] expectedDiagnostics) 8846void verifyReference(MetadataReference reference, CSharpCompilationOptions options, DiagnosticDescription[] expectedDiagnostics) 10412private CompilationVerifier CompileAndVerifyWithSkipLocalsInit(string src, CSharpCompilationOptions options, CSharpParseOptions parseOptions = null, Verification? verify = null)
Attributes\InternalsVisibleToAndStrongNameTests.cs (15)
193var options = TestOptions.SigningReleaseDll.WithStrongNameProvider(s_providerNoSigningTempPath); 208var options = TestOptions.SigningReleaseDll.WithStrongNameProvider(SigningTestHelpers.DefaultDesktopStrongNameProvider); 438var options = TestOptions.SigningReleaseDll 1661var options = TestOptions.SigningReleaseModule.WithCryptoKeyContainer("roslynTestContainer"); 1680var options = TestOptions.SigningReleaseModule.WithCryptoKeyContainer("roslynTestContainer"); 1718var options = TestOptions.SigningReleaseModule.WithCryptoKeyFile(s_keyPairFile); 1734var options = TestOptions.SigningReleaseDll 1755var options = TestOptions.SigningDebugDll.WithCryptoKeyFile(s_keyPairFile); 1778var options = TestOptions.SigningReleaseModule.WithCryptoKeyFile(s_keyPairFile); 1967var options = TestOptions.SigningReleaseDll 2569var options = TestOptions.SigningReleaseDll.WithCryptoKeyFile(s_keyPairFile); 2813var options = TestOptions.DebugDll; 2825var options = TestOptions.DebugDll.WithCryptoKeyFile(string.Empty); 2836var options = TestOptions.DebugDll.WithPublicSign(true); 2848var options = TestOptions.DebugDll.WithCryptoKeyFile(string.Empty).WithPublicSign(true);
Diagnostics\DiagnosticAnalyzerTests.cs (16)
200var options = TestOptions.ReleaseDll.WithGeneralDiagnosticOption(ReportDiagnostic.Error); 286var options = TestOptions.ReleaseDll.WithGeneralDiagnosticOption(ReportDiagnostic.Error); 320var options = TestOptions.ReleaseDll.WithSpecificDiagnosticOptions(specificDiagOptions); 399var options = TestOptions.ReleaseDll.WithGeneralDiagnosticOption(ReportDiagnostic.Default); 451var options = TestOptions.ReleaseDll; 526var options = TestOptions.ReleaseDll; 1142var options = TestOptions.ReleaseDll.WithSpecificDiagnosticOptions(specificDiagOptions); 1283var options = new CSharpCompilationOptions(OutputKind.ConsoleApplication, generalDiagnosticOption: generalOption, specificDiagnosticOptions: specificOptions); 1379var options = compilation.Options.WithConcurrentBuild(true); 1552var options = compilation.Options.WithGeneralDiagnosticOption(ReportDiagnostic.Error); 3385var options = TestOptions.DebugDll.WithSyntaxTreeOptionsProvider( 3428var options = TestOptions.DebugDll.WithSyntaxTreeOptionsProvider( 3480var options = TestOptions.DebugDll.WithSyntaxTreeOptionsProvider( 3532var options = TestOptions.DebugDll.WithSyntaxTreeOptionsProvider( 4179CSharpCompilationOptions options; 4225var options = compilation.Options.WithSyntaxTreeOptionsProvider(new CancellingSyntaxTreeOptionsProvider());
Diagnostics\DiagnosticSuppressorTests.cs (1)
670var options = TestOptions.DebugDll.WithConcurrentBuild(concurrent);
Semantics\ParamsCollectionTests.cs (3)
13155var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All); 13215var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All); 13278var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All);
Semantics\PatternMatchingTestBase.cs (1)
431protected CSharpCompilation CreatePatternCompilation(string source, CSharpCompilationOptions options = null)
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (3)
EndToEndTests.cs (3)
167var options = TestOptions.DebugDll.WithConcurrentBuild(false); 248var options = TestOptions.DebugDll.WithConcurrentBuild(false); 357var options = TestOptions.DebugDll.WithConcurrentBuild(concurrent);
Microsoft.CodeAnalysis.CSharp.Features (9)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (2)
89var compilationOptions = (CSharpCompilationOptions)project.CompilationOptions!;
SemanticSearch\CSharpSemanticSearchUtilities.cs (1)
12public static readonly CSharpCompilationOptions CompilationOptions = new(OutputKind.ConsoleApplication);
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (2)
43var compilationOptions = compilation.Options; 48CSharpCompilationOptions compilationOptions,
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (2)
105var compilationOptions = ((CSharpCompilationOptions)context.SemanticModel.Compilation.Options).NullableContextOptions; 329(defaultCompleted, options: ((CSharpCompilationOptions)semanticModel.Compilation.Options).NullableContextOptions, cancellationToken));
src\Analyzers\CSharp\CodeFixes\UpdateProjectToAllowUnsafe\CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (2)
41var compilationOptions = (CSharpCompilationOptions?)project.CompilationOptions;
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (19)
ConvertToRecord\ConvertToRecordCodeRefactoringTests.cs (4)
4698var compilationOptions = (CSharpCompilationOptions)base.CreateCompilationOptions(); 4741var compilationOptions = (CSharpCompilationOptions)base.CreateCompilationOptions();
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (1)
1062var compilationOptions = TestOptions.DebugDll.WithSpecificDiagnosticOptions(
EnableNullable\EnableNullableTests.cs (6)
36var compilationOptions = (CSharpCompilationOptions)solution.GetRequiredProject(projectId).CompilationOptions!; 52var compilationOptions = (CSharpCompilationOptions)solution.GetRequiredProject(projectId).CompilationOptions!; 552var compilationOptions = (CSharpCompilationOptions)solution.GetRequiredProject(projectId).CompilationOptions!;
ExtractClass\ExtractClassTests.cs (1)
50var unusedCompilationOptions = new CSharpCompilationOptions(OutputKind.NetModule);
src\Analyzers\CSharp\Tests\RemoveUnnecessaryImports\RemoveUnnecessaryImportsTests.cs (2)
2064var compilationOptions = (CSharpCompilationOptions)solution.GetRequiredProject(projectId).CompilationOptions!;
src\Analyzers\CSharp\Tests\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveTests.cs (2)
485var compilationOptions = (CSharpCompilationOptions?)solution.GetRequiredProject(projectId).CompilationOptions;
src\Analyzers\CSharp\Tests\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveTests.cs (2)
240var compilationOptions = (CSharpCompilationOptions?)solution.GetRequiredProject(projectId).CompilationOptions;
src\Analyzers\CSharp\Tests\UpdateProjectToAllowUnsafe\UpdateProjectToAllowUnsafeTests.cs (1)
39Assert.True(((CSharpCompilationOptions)newSolution.Projects.Single().CompilationOptions!).AllowUnsafe);
Microsoft.CodeAnalysis.CSharp.Scripting (2)
CSharpScriptCompiler.cs (2)
79internal static CSharpCompilationOptions WithTopLevelBinderFlags(CSharpCompilationOptions options)
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (2)
InteractiveSessionReferencesTests.cs (2)
34private static readonly CSharpCompilationOptions s_signedDll = 37private static readonly CSharpCompilationOptions s_signedDll2 =
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (59)
Semantics\BetterCandidates.cs (2)
26private CSharpCompilation CreateCompilationWithoutBetterCandidates(string source, CSharpCompilationOptions options = null, MetadataReference[] references = null) 30private CSharpCompilation CreateCompilationWithBetterCandidates(string source, CSharpCompilationOptions options = null, MetadataReference[] references = null)
Semantics\FunctionPointerTests.cs (1)
19private static CSharpCompilation CreateCompilationWithFunctionPointers(string source, CSharpCompilationOptions? options = null, CSharpParseOptions? parseOptions = null, TargetFramework? targetFramework = null)
Semantics\ImplicitObjectCreationTests.cs (2)
21private static CSharpCompilation CreateCompilation(string source, CSharpCompilationOptions options = null, IEnumerable<MetadataReference> references = null) 4380var signedDll = TestOptions.ReleaseDll.WithCryptoPublicKey(TestResources.TestKeys.PublicKey_ce65828c82a341f2);
Semantics\InteractiveUsingTests.cs (4)
159var options = TestOptions.DebugDll.WithUsings("System"); 268var options = TestOptions.DebugDll.WithUsings("System"); 298var options = TestOptions.DebugDll.WithUsings("System"); 325var options = TestOptions.DebugDll.WithUsings("B");
Semantics\InterpolationTests.cs (4)
1159var compOptions = new CSharpCompilationOptions(OutputKind.ConsoleApplication); 1262var compOptions = new CSharpCompilationOptions(OutputKind.ConsoleApplication); 1370var compOptions = new CSharpCompilationOptions(OutputKind.ConsoleApplication); 1422var compOptions = new CSharpCompilationOptions(OutputKind.ConsoleApplication);
Semantics\LocalFunctionTests.cs (1)
4011var option = TestOptions.ReleaseExe;
Semantics\NameOfTests.cs (8)
240var option = TestOptions.ReleaseExe.WithWarningLevel(0); 420var option = TestOptions.ReleaseExe.WithWarningLevel(0); 1707var option = TestOptions.ReleaseDll; 1724var option = TestOptions.ReleaseDll; 1737var option = TestOptions.ReleaseDll; 1752var option = TestOptions.ReleaseDll; 1766var option = TestOptions.ReleaseDll; 1791var option = TestOptions.ReleaseDll;
Semantics\NullableContextTests.cs (5)
558var options = TestOptions.ReleaseDll; 1023var options = TestOptions.ReleaseDll.WithNullableContextOptions(NullableContextOptions.Disable); 1062static void verify(string[] source, CSharpCompilationOptions options, string[] expectedAnalyzedKeys, params DiagnosticDescription[] expectedDiagnostics) 1735var options = TestOptions.ReleaseExe; 2223var options = TestOptions.ReleaseDll;
Semantics\NullableReferenceTypesTests.cs (28)
14383foreach (var options1 in new[] { WithNullableEnable(), WithNullableDisable() }) 14390foreach (var options2 in new[] { WithNullableEnable(), WithNullableDisable() }) 105862foreach (var options in new[] { WithNullableEnable(), WithNullableDisable() }) 113230CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 113296CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 113368CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 113420CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 113475CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 113530CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 113588CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 113646CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 113689CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 113744CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 114246CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 114304CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 114365CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 114423CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 114459CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 114496CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 114532CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 114562CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 114594CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 125124CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 125309CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 125458CSharpCompilationOptions options = WithNullable(nullableContextOptions); 125998CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 126073CSharpCompilationOptions compilationOptions = WithNullable(nullableContextOptions); 126143CSharpCompilationOptions options = WithNullable(nullableContextOptions);
Semantics\UninitializedNonNullableFieldTests.cs (1)
2782var options = WithNullableEnable();
Semantics\UseSiteErrorTests.cs (1)
2260CSharpCompilationOptions options = TestOptions.UnsafeReleaseDll;
SourceGeneration\GeneratorDriverTests.cs (2)
1168var options = ((CSharpCompilationOptions)compilation.Options);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (70)
Compilation\CompilationAPITests.cs (14)
37private CSharpCompilationOptions WithDiagnosticOptions( 71var options = TestOptions.DebugDll 101var options = WithDiagnosticOptions(tree, ("CS0078", ReportDiagnostic.Suppress)); 126var options = WithDiagnosticOptions(tree, ("CS0078", ReportDiagnostic.Error)); 139var options = WithDiagnosticOptions(tree, ("CS0078", ReportDiagnostic.Suppress)); 167var options = TestOptions.DebugDll.WithSyntaxTreeOptionsProvider( 194var options = TestOptions.DebugDll.WithSyntaxTreeOptionsProvider( 239var options = TestOptions.DebugDll 288var compilationOptions = TestOptions.DebugDll.WithWarningLevel(0); 358var ops = TestOptions.ReleaseExe; 371var ops1 = TestOptions.DebugExe; 487var opt = TestOptions.DebugExe; 1377var opt = TestOptions.ReleaseDll; 2384var compilationOptions = TestOptions.DebugDll;
Compilation\CSharpCompilationOptionsTests.cs (17)
22public static void VerifyErrors(this CSharpCompilationOptions options, params DiagnosticDescription[] expected) 31/// Using an instance of <see cref="CSharpCompilationOptions"/>, tests a property in <see cref="CompilationOptions"/> , even it is hidden by <see cref="CSharpCompilationOptions"/>. 99Func<CSharpCompilationOptions, T, CSharpCompilationOptions> factory, 100Func<CSharpCompilationOptions, T> getter, 192var defaultWarnings = new CSharpCompilationOptions(OutputKind.ConsoleApplication); 358/// and <see cref="CSharpCompilationOptions.Equals(CSharpCompilationOptions)"/> methods to 366typeof(CSharpCompilationOptions), 377CSharpCompilationOptions first = CreateCSharpCompilationOptions(); 378CSharpCompilationOptions second = CreateCSharpCompilationOptions(); 383private static CSharpCompilationOptions CreateCSharpCompilationOptions() 442var options = new CSharpCompilationOptions(OutputKind.ConsoleApplication); 457var options = new CSharpCompilationOptions[values.Length]; 467var oldOptions = options[i]; 471var newOptions = oldOptions.WithNullableContextOptions(values[j]);
Compilation\LoadDirectiveTests.cs (5)
21var options = TestOptions.DebugDll.WithSourceReferenceResolver(TestSourceReferenceResolver.Default); 34var options = TestOptions.DebugDll.WithSourceReferenceResolver(TestSourceReferenceResolver.Default); 53var options = TestOptions.DebugDll.WithSourceReferenceResolver(resolver); 78var options = TestOptions.DebugDll.WithSourceReferenceResolver(resolver); 156var options = TestOptions.DebugDll.WithSourceReferenceResolver(resolver);
Compilation\ReferenceManagerTests.cs (3)
26private static readonly CSharpCompilationOptions s_signedDll = 3171var options = TestOptions.ReleaseDll.WithAssemblyIdentityComparer(DesktopAssemblyIdentityComparer.Default); 3214var options = TestOptions.ReleaseDll.WithAssemblyIdentityComparer(DesktopAssemblyIdentityComparer.Default);
Compilation\SemanticModelAPITests.cs (2)
4469var options = WithNullable(TestOptions.DebugExe, nullableContextOption); 4524var options = WithNullable(TestOptions.DebugExe, nullableContextOption);
Compilation\UsedAssembliesTests.cs (3)
256private Compilation AssertUsedAssemblyReferences(string source, MetadataReference[] references, MetadataReference[] expected, CSharpParseOptions parseOptions, CSharpCompilationOptions options = null) 292private ImmutableArray<MetadataReference> CompileWithUsedAssemblyReferences(string source, TargetFramework targetFramework, CSharpCompilationOptions options, params MetadataReference[] references) 356private void CompileWithUsedAssemblyReferences(string source, CSharpCompilationOptions options, params MetadataReference[] references)
DocumentationComments\CrefTests.cs (2)
6918var options = TestOptions.ReleaseDll.WithXmlReferenceResolver(XmlFileResolver.Default); 6942var options = TestOptions.ReleaseDll.WithXmlReferenceResolver(XmlFileResolver.Default);
DocumentationComments\DocumentationCommentCompilerTests.cs (2)
30CSharpCompilationOptions options = null, 7116var compOptions = TestOptions.ReleaseDll.WithGeneralDiagnosticOption(ReportDiagnostic.Error);
Symbols\CovariantReturnTests.cs (3)
400CSharpCompilationOptions options = null, 419CSharpCompilationOptions options = null, 439CSharpCompilationOptions options = null,
Symbols\DefaultInterfaceImplementationTests.cs (2)
36984foreach (var options in new[] { TestOptions.DebugExe, TestOptions.DebugExe.WithMetadataImportOptions(MetadataImportOptions.All) }) 62705foreach (var options in new[] { TestOptions.DebugDll, TestOptions.DebugWinMD })
Symbols\ExtensionMethodTests.cs (1)
2747CSharpCompilationOptions options = null)
Symbols\Metadata\MetadataMemberTests.cs (10)
691var options = TestOptions.DebugDll; 711Assert.Equal(MetadataImportOptions.Internal, ((CSharpCompilationOptions)commonOptions).MetadataImportOptions); 712((CSharpCompilationOptions)commonOptions).VerifyErrors(); 714Assert.Equal(MetadataImportOptions.All, ((CSharpCompilationOptions)commonOptions).MetadataImportOptions); 715((CSharpCompilationOptions)commonOptions).VerifyErrors(); 717Assert.Equal(MetadataImportOptions.Public, ((CSharpCompilationOptions)commonOptions).MetadataImportOptions); 718((CSharpCompilationOptions)commonOptions).VerifyErrors(); 720Assert.Equal((MetadataImportOptions)byte.MaxValue, ((CSharpCompilationOptions)commonOptions).MetadataImportOptions); 721((CSharpCompilationOptions)commonOptions).VerifyErrors(expectedDiagnostics); 773var options = TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.Internal);
Symbols\ModuleInitializers\ModuleInitializersTests.cs (3)
815var moduleOptions = TestOptions.ReleaseModule.WithMetadataImportOptions(MetadataImportOptions.All); 852var exeOptions = TestOptions.ReleaseExe 1066var exeOptions = TestOptions.ReleaseExe
Symbols\RequiredMembersTests.cs (1)
22private static CSharpCompilation CreateCompilationWithRequiredMembers(CSharpTestSource source, IEnumerable<MetadataReference>? references = null, CSharpParseOptions? parseOptions = null, CSharpCompilationOptions? options = null, string? assemblyName = null, TargetFramework targetFramework = TargetFramework.Standard)
Symbols\Source\FileModifierTests.cs (1)
834var options = TestOptions.DebugDll.WithDeterministic(true);
Symbols\Source\PropertyTests.cs (1)
2579private CSharpCompilation CompileWithCustomPropertiesAssembly(string source, CSharpCompilationOptions options = null)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (60)
Diagnostics\DiagnosticTest.cs (60)
571CSharpCompilationOptions option = TestOptions.ReleaseExe.WithSpecificDiagnosticOptions(warnings); 604CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 615CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 667CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 675CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 715CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 726CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 771CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 782CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 827CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 838CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 885CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 896CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 943CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 954CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 999CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 1013CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 1066CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 1083CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 1140CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 1154CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 1211CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 1219CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 1264CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 1272CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 1318CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 1326CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 1371CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 1376CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 1419CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 1427CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 1466CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 1483CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 1536CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 1550CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 1583CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 1600CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 1642CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 1656CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 1692CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 1703CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 1735CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 1740CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 1762CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 1773CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 1808CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 1822CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 1875CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 1917CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 1978CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 2014CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 2050CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 2097CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 2143var options = TestOptions.DebugDll.WithGeneralDiagnosticOption(ReportDiagnostic.Suppress); 2201CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 2226CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 2246CSharpCompilationOptions option = commonoption.WithSpecificDiagnosticOptions(warnings); 2309CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 2331CSharpCompilationOptions commonoption = TestOptions.ReleaseExe; 2526CSharpCompilationOptions options = TestOptions.ReleaseExe;
Microsoft.CodeAnalysis.CSharp.Test.Utilities (79)
CSharpTestBase.cs (52)
777protected static CSharpCompilationOptions WithNullableEnable(CSharpCompilationOptions options = null) 782protected static CSharpCompilationOptions WithNullableDisable(CSharpCompilationOptions options = null) 787protected static CSharpCompilationOptions WithNullable(NullableContextOptions nullableContextOptions) 792protected static CSharpCompilationOptions WithNullable(CSharpCompilationOptions options, NullableContextOptions nullableContextOptions) 810CSharpCompilationOptions options = null, 846CSharpCompilationOptions options = null, 883CSharpCompilationOptions options = null, 924CSharpCompilationOptions options = null, 960CSharpCompilationOptions options = null, 996CSharpCompilationOptions options = null, 1122CSharpCompilationOptions options = null, 1131CSharpCompilationOptions options = null, 1143CSharpCompilationOptions options = null, 1151CSharpCompilationOptions options = null, 1160CSharpCompilationOptions options = null, 1169CSharpCompilationOptions options = null, 1178CSharpCompilationOptions options = null, 1187CSharpCompilationOptions options = null, 1195CSharpCompilationOptions options = null, 1203CSharpCompilationOptions options = null, 1211CSharpCompilationOptions options = null, 1219CSharpCompilationOptions options = null, 1227CSharpCompilationOptions options = null, 1240CSharpCompilationOptions options = null, 1267CSharpCompilationOptions options = null, 1280CSharpCompilationOptions options = null, 1290CSharpCompilationOptions options, 1335private static CSharpCompilationOptions CheckForTopLevelStatements(SyntaxTree[] syntaxTrees) 1339var options = hasTopLevelStatements ? TestOptions.ReleaseExe : TestOptions.ReleaseDll; 1439CSharpCompilationOptions options = null, 1456CSharpCompilationOptions options = null, 1479CSharpCompilationOptions options = null, 1499var compilationOptions = (expectedOutput != null) ? TestOptions.ReleaseExe : TestOptions.ReleaseDll; 2056CSharpCompilationOptions compilationOptions = null, 2108CSharpCompilationOptions compilationOptions = null, 2144CSharpCompilationOptions compilationOptions = null, 2165CSharpCompilationOptions compilationOptions = null, 2184CSharpCompilationOptions compilationOptions = null, 2202CSharpCompilationOptions compilationOptions = null, 2223CSharpCompilationOptions compilationOptions = null, 2241CSharpCompilationOptions compilationOptions = null, 2257protected static CSharpCompilation CreateCompilationWithSpan(CSharpTestSource tree, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 2274protected static CSharpCompilation CreateCompilationWithMscorlibAndSpan(CSharpTestSource text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 2292protected static CSharpCompilation CreateCompilationWithMscorlibAndSpanSrc(string text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 2306protected static CSharpCompilation CreateCompilationWithIndex(CSharpTestSource text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 2317protected static CSharpCompilation CreateCompilationWithIndexAndRange(CSharpTestSource text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 2328protected static CSharpCompilation CreateCompilationWithIndexAndRangeAndSpan(CSharpTestSource text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 2339protected static CSharpCompilation CreateCompilationWithSpanAndMemoryExtensions(CSharpTestSource text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null, TargetFramework targetFramework = TargetFramework.NetCoreApp) 2357protected static CSharpCompilation CreateCompilationWithIndexAndRangeAndSpanAndMemoryExtensions(CSharpTestSource text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null, TargetFramework targetFramework = TargetFramework.NetCoreApp)
MetadataTestHelpers.cs (1)
46CSharpCompilationOptions options = null)
TestOptions.cs (26)
72public static readonly CSharpCompilationOptions ReleaseDll = CreateTestOptions(OutputKind.DynamicallyLinkedLibrary, OptimizationLevel.Release); 73public static readonly CSharpCompilationOptions ReleaseExe = CreateTestOptions(OutputKind.ConsoleApplication, OptimizationLevel.Release); 75public static readonly CSharpCompilationOptions ReleaseDebugDll = ReleaseDll.WithDebugPlusMode(true); 77public static readonly CSharpCompilationOptions ReleaseDebugExe = ReleaseExe.WithDebugPlusMode(true); 79public static readonly CSharpCompilationOptions DebugDll = CreateTestOptions(OutputKind.DynamicallyLinkedLibrary, OptimizationLevel.Debug); 80public static readonly CSharpCompilationOptions DebugExe = CreateTestOptions(OutputKind.ConsoleApplication, OptimizationLevel.Debug); 82public static readonly CSharpCompilationOptions DebugDllThrowing = DebugDll.WithMetadataReferenceResolver(new ThrowingMetadataReferenceResolver()); 83public static readonly CSharpCompilationOptions DebugExeThrowing = DebugExe.WithMetadataReferenceResolver(new ThrowingMetadataReferenceResolver()); 85public static readonly CSharpCompilationOptions ReleaseWinMD = CreateTestOptions(OutputKind.WindowsRuntimeMetadata, OptimizationLevel.Release); 86public static readonly CSharpCompilationOptions DebugWinMD = CreateTestOptions(OutputKind.WindowsRuntimeMetadata, OptimizationLevel.Debug); 88public static readonly CSharpCompilationOptions ReleaseModule = CreateTestOptions(OutputKind.NetModule, OptimizationLevel.Release); 89public static readonly CSharpCompilationOptions DebugModule = CreateTestOptions(OutputKind.NetModule, OptimizationLevel.Debug); 91public static readonly CSharpCompilationOptions UnsafeReleaseDll = ReleaseDll.WithAllowUnsafe(true); 92public static readonly CSharpCompilationOptions UnsafeReleaseExe = ReleaseExe.WithAllowUnsafe(true); 94public static readonly CSharpCompilationOptions UnsafeDebugDll = DebugDll.WithAllowUnsafe(true); 95public static readonly CSharpCompilationOptions UnsafeDebugExe = DebugExe.WithAllowUnsafe(true); 97public static readonly CSharpCompilationOptions SigningReleaseDll = ReleaseDll.WithStrongNameProvider(SigningTestHelpers.DefaultDesktopStrongNameProvider); 98public static readonly CSharpCompilationOptions SigningReleaseExe = ReleaseExe.WithStrongNameProvider(SigningTestHelpers.DefaultDesktopStrongNameProvider); 99public static readonly CSharpCompilationOptions SigningReleaseModule = ReleaseModule.WithStrongNameProvider(SigningTestHelpers.DefaultDesktopStrongNameProvider); 100public static readonly CSharpCompilationOptions SigningDebugDll = DebugDll.WithStrongNameProvider(SigningTestHelpers.DefaultDesktopStrongNameProvider); 172public static CSharpCompilationOptions WithSpecificDiagnosticOptions(this CSharpCompilationOptions options, string key, ReportDiagnostic value) 177public static CSharpCompilationOptions WithSpecificDiagnosticOptions(this CSharpCompilationOptions options, string key1, string key2, ReportDiagnostic value) 183/// Create <see cref="CSharpCompilationOptions"/> with the maximum warning level. 189internal static CSharpCompilationOptions CreateTestOptions(OutputKind outputKind, OptimizationLevel optimizationLevel, bool allowUnsafe = false)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
PdbTests.cs (1)
119var ops = TestOptions.ReleaseDll;
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
Serialization\CSharpOptionsSerializationService.cs (2)
30var csharpOptions = (CSharpCompilationOptions)options;
Workspace\LanguageServices\CSharpCompilationFactoryService.cs (3)
18private static readonly CSharpCompilationOptions s_defaultOptions = new(OutputKind.ConsoleApplication, concurrentBuild: false); 30options: (CSharpCompilationOptions)options ?? s_defaultOptions); 37options: (CSharpCompilationOptions)options,
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
CodeGeneration\CodeGenerationTests.cs (1)
994: TestWorkspace.CreateCSharp(file, (CS.CSharpParseOptions)parseOptions, (CS.CSharpCompilationOptions)compilationOptions);
Utilities\SymbolEquivalenceComparerTests.cs (2)
25public static readonly CS.CSharpCompilationOptions CSharpDllOptions = new CS.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary); 26public static readonly CS.CSharpCompilationOptions CSharpSignedDllOptions = new CS.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).
Microsoft.CodeAnalysis.Rebuild (4)
CSharpCompilationFactory.cs (4)
20public new CSharpCompilationOptions CompilationOptions { get; } 29CSharpCompilationOptions compilationOptions) 56private static (CSharpCompilationOptions, CSharpParseOptions) CreateCSharpCompilationOptions(string assemblyFileName, CompilationOptionsReader optionsReader) 86var compilationOptions = new CSharpCompilationOptions(
Microsoft.CodeAnalysis.Rebuild.UnitTests (9)
CSharpDeterministicKeyBuilderTests.cs (8)
23public sealed class CSharpDeterministicKeyBuilderTests : DeterministicKeyBuilderTests<CSharpCompilation, CSharpCompilationOptions, CSharpParseOptions> 25public static CSharpCompilationOptions Options { get; } = new CSharpCompilationOptions(OutputKind.ConsoleApplication, deterministic: true); 35protected override CSharpCompilation CreateCompilation(SyntaxTree[] syntaxTrees, MetadataReference[]? references = null, CSharpCompilationOptions? options = null) => 44protected override CSharpCompilationOptions GetCompilationOptions() => Options; 60verifyCount<CSharpCompilationOptions>(9); 278var options = Options 315var options = Options.WithUsings(usings); 414var options = Options
OptionRoundTripTests.cs (1)
27public static readonly CSharpCompilationOptions BaseCSharpCompilationOptions = TestOptions.DebugExe.WithDeterministic(true);
Microsoft.CodeAnalysis.Scripting.TestUtilities (1)
TestCompilationFactory.cs (1)
38internal static Compilation CreateCSharpCompilation(string source, IEnumerable<MetadataReference> references, string assemblyName = null, CSharpCompilationOptions options = null)
Microsoft.CodeAnalysis.Test.Utilities (10)
AssemblyLoadTestFixture.cs (1)
523CSharpCompilationOptions options = new(OutputKind.DynamicallyLinkedLibrary, warningLevel: Diagnostic.MaxWarningLevel);
CommonTestBase.cs (6)
263CSharp.CSharpCompilationOptions compilationOptions = null, 274CSharp.CSharpCompilationOptions compilationOptions = null, 317CSharp.CSharpCompilationOptions compilationOptions = null, 328CSharp.CSharpCompilationOptions compilationOptions = null, 339CSharp.CSharpCompilationOptions compilationOptions = null, 351CSharp.CSharpCompilationOptions compilationOptions = null,
Mocks\Silverlight.cs (1)
81var options = new CSharpCompilationOptions(
Mocks\StdOle.cs (1)
68var options = new CSharpCompilationOptions(
TestBase.cs (1)
194var compilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary);
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\CompilationWithAnalyzersTests.cs (1)
23private static readonly CSharpCompilationOptions s_dllWithMaxWarningLevel = new(OutputKind.DynamicallyLinkedLibrary, warningLevel: CodeAnalysis.Diagnostic.MaxWarningLevel);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (4)
MSBuildWorkspaceTestBase.cs (4)
32protected async Task AssertCSCompilationOptionsAsync<T>(T expected, Func<CS.CSharpCompilationOptions, T> actual) 34var options = await LoadCSharpCompilationOptionsAsync(); 56protected async Task<CS.CSharpCompilationOptions> LoadCSharpCompilationOptionsAsync() 62return (CS.CSharpCompilationOptions)project.CompilationOptions;
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
Workspaces\TestWorkspace_XmlConsumption.cs (1)
529compilationOptions = ((CSharpCompilationOptions)compilationOptions).WithAllowUnsafe(allowUnsafe).WithNullableContextOptions(nullable);
Workspaces\TestWorkspace_XmlCreation.cs (1)
149if (options is CodeAnalysis.CSharp.CSharpCompilationOptions csOptions)
Microsoft.CodeAnalysis.Workspaces.UnitTests (4)
Host\LanguageServices\TestCSharpCompilationFactoryServiceWithIncrementalGeneratorTracking.cs (3)
20private static readonly CSharpCompilationOptions s_defaultOptions = new(OutputKind.ConsoleApplication, concurrentBuild: false); 32options: (CSharpCompilationOptions)options ?? s_defaultOptions); 39options: (CSharpCompilationOptions)options,
SolutionTests\SolutionTests.cs (1)
1724var options = new CSharpCompilationOptions(OutputKind.NetModule);
Microsoft.Interop.ComInterfaceGenerator (4)
ComClassGenerator.cs (1)
21var unsafeCodeIsEnabled = context.CompilationProvider.Select((comp, ct) => comp.Options is CSharpCompilationOptions { AllowUnsafe: true }); // Unsafe code enabled
ComInterfaceInfo.cs (1)
57if (env.Compilation.Options is not CSharpCompilationOptions { AllowUnsafe: true }) // Unsafe code enabled
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (2)
127bool enableUnsafe = doc.Project.CompilationOptions is CSharpCompilationOptions { AllowUnsafe: false }; 229return solution.WithProjectCompilationOptions(project.Id, ((CSharpCompilationOptions)project.CompilationOptions).WithAllowUnsafe(true));
Microsoft.Interop.JavaScript.JSImportGenerator (2)
JSExportGenerator.cs (1)
67|| data.Left.Compilation.Options is CSharpCompilationOptions { AllowUnsafe: true }) // Unsafe code enabled
JSImportGenerator.cs (1)
65|| data.Left.Compilation.Options is CSharpCompilationOptions { AllowUnsafe: true }) // Unsafe code enabled
Microsoft.Interop.LibraryImportGenerator (3)
LibraryImportGenerator.cs (1)
73.Select((comp, ct) => comp.Options is CSharpCompilationOptions { AllowUnsafe: true })
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (2)
127bool enableUnsafe = doc.Project.CompilationOptions is CSharpCompilationOptions { AllowUnsafe: false }; 229return solution.WithProjectCompilationOptions(project.Id, ((CSharpCompilationOptions)project.CompilationOptions).WithAllowUnsafe(true));
Microsoft.VisualStudio.LanguageServices.CSharp (9)
ProjectSystemShim\CSharpProjectShim.OptionsProcessor.cs (1)
138return ((CSharpCompilationOptions)compilationOptions).WithAllowUnsafe(GetBooleanOption(CompilerOptions.OPTID_UNSAFE))
Utilities\CSharpCompilationOptionsChangingService.cs (8)
26var oldCSharpOptions = (CSharpCompilationOptions)oldOptions; 27var newCSharpOptions = (CSharpCompilationOptions)newOptions; 35var oldCSharpOptions = (CSharpCompilationOptions)oldOptions; 36var newCSharpOptions = (CSharpCompilationOptions)newOptions;
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (18)
ProjectSystemShim\CPS\AnalyzersTests.cs (3)
35var options = (CSharpCompilationOptions)workspaceProject.CompilationOptions; 42options = (CSharpCompilationOptions)workspaceProject.CompilationOptions;
ProjectSystemShim\LegacyProject\AnalyzersTests.cs (15)
39var options = (CSharpCompilationOptions)environment.GetUpdatedCompilationOptionOfSingleProject(); 45options = (CSharpCompilationOptions)environment.GetUpdatedCompilationOptionOfSingleProject(); 80var options = (CSharpCompilationOptions)workspaceProject.CompilationOptions; 87options = (CSharpCompilationOptions)workspaceProject.CompilationOptions; 110var options = (CSharpCompilationOptions)environment.GetUpdatedCompilationOptionOfSingleProject(); 134var options = (CSharpCompilationOptions)environment.GetUpdatedCompilationOptionOfSingleProject(); 214var options = (CSharpCompilationOptions)workspaceProject.CompilationOptions; 245var options = (CSharpCompilationOptions)environment.GetUpdatedCompilationOptionOfSingleProject(); 258options = (CSharpCompilationOptions)environment.GetUpdatedCompilationOptionOfSingleProject();
StackDepthTest (1)
Program.cs (1)
78var options = new CSharpCompilationOptions(outputKind: OutputKind.DynamicallyLinkedLibrary, concurrentBuild: false);
System.Text.RegularExpressions.Generator (1)
RegexGenerator.Parser.cs (1)
210var compilationData = compilation is CSharpCompilation { LanguageVersion: LanguageVersion langVersion, Options: CSharpCompilationOptions compilationOptions }
VBCSCompiler.UnitTests (1)
AnalyzerConsistencyCheckerTests.cs (1)
58var options = new CSharpCompilationOptions(