Skip to content

Allow Razor cohosting to work with non-Razor SDK projects#9733

Merged
drewnoakes merged 6 commits intodotnet:mainfrom
davidwengier:RazorForNonRazorSdk
Aug 21, 2025
Merged

Allow Razor cohosting to work with non-Razor SDK projects#9733
drewnoakes merged 6 commits intodotnet:mainfrom
davidwengier:RazorForNonRazorSdk

Conversation

@davidwengier
Copy link
Member

@davidwengier davidwengier commented Aug 19, 2025

Part of dotnet/razor#11834

Microsoft Reviewers: Open in CodeFlow

<!-- .NET Framework uses a different editor in VS -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework' And 'UsingMicrosoftNETSdkRazor' != 'true'">
<!-- Collect all Razor and CSHTML files -->
<_RazorOrCshtmlFiles Include="**\*.razor;**\*.cshtml" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these items already in an item group somewhere that we can piggy back off? It'd be nice to avoid adding more globs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is any consistency here, they could be in Content or None, but they could be nowhere. My last contribution to this repo was actually around the same issue, because Maui and Bing did weird and different things: #7417

This really is a last resort catch all we're having to write.

…/DesignTimeTargets/Microsoft.CSharp.DesignTime.targets
…/DesignTimeTargets/Microsoft.CSharp.DesignTime.targets
Copy link
Member

@drewnoakes drewnoakes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

…/DesignTimeTargets/Microsoft.CSharp.DesignTime.targets

Co-authored-by: Drew Noakes <git@drewnoakes.com>
@drewnoakes drewnoakes merged commit 38d1b59 into dotnet:main Aug 21, 2025
5 checks passed
@davidwengier davidwengier deleted the RazorForNonRazorSdk branch August 21, 2025 00:18
@dotnet-policy-service dotnet-policy-service bot added this to the 17.15 milestone Aug 21, 2025
drewnoakes added a commit to drewnoakes/project-system that referenced this pull request Sep 3, 2025
…azorSdk"

This reverts commit 38d1b59, reversing
changes made to 5c47ff0.
drewnoakes added a commit that referenced this pull request Sep 3, 2025
[dev18.0.x] Revert "Merge pull request #9733 from davidwengier/RazorForNonRazorSdk"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants