Skip to content

Commit bde4f70

Browse files
authored
Revert "Default the cohosting option in the generator to on. (#12214)" (#12225)
This reverts commit c10310b.
1 parent 34bcb6b commit bde4f70

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/SourceGenerators/RazorCohostingOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ internal static class RazorCohostingOptions
55
/// <summary>
66
/// True if razor is running in the cohosting mode
77
/// </summary>
8-
internal static bool UseRazorCohostServer { get; set; } = true;
8+
internal static bool UseRazorCohostServer { get; set; } = false;
99
}

src/Compiler/test/Microsoft.NET.Sdk.Razor.SourceGenerators.Tests/RazorSourceGeneratorTests.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
using System.Linq;
1111
using System.Text;
1212
using System.Threading.Tasks;
13-
using Microsoft.AspNetCore.Razor.Language.Syntax;
1413
using Microsoft.CodeAnalysis;
1514
using Microsoft.CodeAnalysis.CSharp;
1615
using Microsoft.CodeAnalysis.Test.Utilities;
@@ -2616,9 +2615,6 @@ public async Task SourceGenerator_DoesNotUpdateSources_WhenSourceGeneratorIsSupp
26162615
// start with the generator suppressed (this is the default state in VS)
26172616
driver = SetSuppressionState(true);
26182617

2619-
// Disable co-hosting, this test only applies to non-cohosting scenarios
2620-
RazorCohostingOptions.UseRazorCohostServer = false;
2621-
26222618
// results should be empty, and no recorded steps should have run
26232619
using var eventListener = new RazorEventListener();
26242620
var result = RunGenerator(compilation!, ref driver).VerifyPageOutput();
@@ -3461,7 +3457,6 @@ public async Task UseRazorCohostServer_CanOverride_Suppression()
34613457
["Component.Razor"] = "<h1>Hello world</h1>",
34623458
});
34633459
var compilation = await project.GetCompilationAsync();
3464-
RazorCohostingOptions.UseRazorCohostServer = false;
34653460

34663461
// Start with the generator suppressed
34673462
var (driver, additionalTexts, optionsProvider) = await GetDriverWithAdditionalTextAndProviderAsync(project, configureGlobalOptions: (o) =>

0 commit comments

Comments
 (0)