Skip to content

Commit 4733227

Browse files
authored
Revert "Revert "Revert "Default the cohosting option in the generator to on.""" (#12318)
Reverts #12253
2 parents 9e7691b + bf50b16 commit 4733227

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;
@@ -2623,9 +2622,6 @@ public async Task SourceGenerator_DoesNotUpdateSources_WhenSourceGeneratorIsSupp
26232622
// start with the generator suppressed (this is the default state in VS)
26242623
driver = SetSuppressionState(true);
26252624

2626-
// Disable co-hosting, this test only applies to non-cohosting scenarios
2627-
RazorCohostingOptions.UseRazorCohostServer = false;
2628-
26292625
// results should be empty, and no recorded steps should have run
26302626
using var eventListener = new RazorEventListener();
26312627
var result = RunGenerator(compilation!, ref driver).VerifyPageOutput();
@@ -3468,7 +3464,6 @@ public async Task UseRazorCohostServer_CanOverride_Suppression()
34683464
["Component.Razor"] = "<h1>Hello world</h1>",
34693465
});
34703466
var compilation = await project.GetCompilationAsync();
3471-
RazorCohostingOptions.UseRazorCohostServer = false;
34723467

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

0 commit comments

Comments
 (0)