Skip to content

Commit abe0e5f

Browse files
update (#9844)
Co-authored-by: XiaoYun Zhang <[email protected]>
1 parent 7b23def commit abe0e5f

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Debug/ProjectLaunchTargetsProvider.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ public async Task OnAfterLaunchAsync(DebugLaunchOptions launchOptions, ILaunchPr
115115
ConfiguredProject project = await GetConfiguredProjectForDebugAsync();
116116

117117
IProjectHotReloadSessionManager? hotReloadSessionManager = project.GetExportedServiceOrDefault<IProjectHotReloadSessionManager>();
118-
119-
if (hotReloadSessionManager is not null)
118+
bool isDebugging = (launchOptions & DebugLaunchOptions.NoDebug) != DebugLaunchOptions.NoDebug;
119+
if (hotReloadSessionManager is not null && await _hotReloadOptionService.Value.IsHotReloadEnabledAsync(isDebugging, default) is true)
120120
{
121121
await hotReloadSessionManager.ActivateSessionAsync(null, processInfos[0]);
122122
}
@@ -132,8 +132,8 @@ public async Task OnAfterLaunchAsync(
132132
ConfiguredProject project = await GetConfiguredProjectForDebugAsync();
133133

134134
IProjectHotReloadSessionManager? hotReloadSessionManager = project.GetExportedServiceOrDefault<IProjectHotReloadSessionManager>();
135-
136-
if (hotReloadSessionManager is not null)
135+
bool isDebugging = (launchOptions & DebugLaunchOptions.NoDebug) != DebugLaunchOptions.NoDebug;
136+
if (hotReloadSessionManager is not null && await _hotReloadOptionService.Value.IsHotReloadEnabledAsync(isDebugging, default) is true)
137137
{
138138
await hotReloadSessionManager.ActivateSessionAsync(vsLaunchedProcess, processInfo);
139139
}

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/HotReload/ProjectHotReloadSessionManager.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,6 @@ async Task ApplyHotReloadUpdateInternalAsync()
195195

196196
public Task ActivateSessionAsync(IVsLaunchedProcess? launchedProcess, VsDebugTargetProcessInfo vsDebugTargetProcessInfo)
197197
{
198-
Assumes.True(_pendingSessionState is not null, "No pending hot reload session to activate.");
199-
200198
return _semaphore.ExecuteAsync(ActivateSessionInternalAsync);
201199

202200
async Task ActivateSessionInternalAsync()

0 commit comments

Comments
 (0)