Skip to content

Add ICssHotReloadServiceFactory#9859

Merged
LittleLittleCloud merged 3 commits intomainfrom
u/xiaoyun/updateCssHotReloadContract
Nov 21, 2025
Merged

Add ICssHotReloadServiceFactory#9859
LittleLittleCloud merged 3 commits intomainfrom
u/xiaoyun/updateCssHotReloadContract

Conversation

@LittleLittleCloud
Copy link
Member

Generally, we only want to active ICssHotReloadService when there's a debug session. So

Therefore this PR adds a ICssHotReloadServiceFactory as a MEF component to create ICssHotReloadService. The ICssHotReloadServiceFactory's lifetime will be the same as PS host. And the lifetime management of ICssHotReloadService will belong to the owner class who creates ICssHotReloadService

@LittleLittleCloud LittleLittleCloud requested a review from a team as a code owner November 20, 2025 21:06
@LittleLittleCloud LittleLittleCloud enabled auto-merge (squash) November 20, 2025 22:06
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.

Approving, but I would suggest you first experiment with using an ExportFactory<T> on the consumption side instead of merging this PR. It'd avoid needing a new public interface, and using ExportFactory<T> is likely more flexible.

You can import ExportFactory<ICssHotReloadService> via MEF (just as you would import ICssHotReloadServiceFactory) then call CreateExport() on it to get an ExportLifetimeContext<ICssHotReloadServiceFactory> which you can then use the Value of, and Dispose it when you're done.

@LittleLittleCloud LittleLittleCloud merged commit 23b56a2 into main Nov 21, 2025
5 checks passed
@LittleLittleCloud LittleLittleCloud deleted the u/xiaoyun/updateCssHotReloadContract branch November 21, 2025 04:00
@dotnet-policy-service dotnet-policy-service bot added this to the 18.1 milestone Nov 21, 2025
@drewnoakes
Copy link
Member

Oh I didn't see it was set to auto complete...

LittleLittleCloud added a commit that referenced this pull request Nov 24, 2025
LittleLittleCloud added a commit that referenced this pull request Nov 24, 2025
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.

3 participants