Skip to content

Commit 3011043

Browse files
authored
[release/8.0.3xx] Update dependencies from dotnet/razor (#44904)
2 parents 716c6b6 + 7fb5f08 commit 3011043

File tree

3 files changed

+43
-35
lines changed

3 files changed

+43
-35
lines changed

eng/Version.Details.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,18 +293,18 @@
293293
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore</Uri>
294294
<Sha>47576478939fdd59b4400ad135f47938af486ab3</Sha>
295295
</Dependency>
296-
<Dependency Name="Microsoft.CodeAnalysis.Razor.Tooling.Internal" Version="7.0.0-preview.24523.2">
296+
<Dependency Name="Microsoft.CodeAnalysis.Razor.Tooling.Internal" Version="7.0.0-preview.24565.5">
297297
<Uri>https://github.com/dotnet/razor</Uri>
298-
<Sha>5161ec13b0ed670b69f3fe5b2c57f239ce63c28e</Sha>
298+
<Sha>aa2c76f75e60f3f6ae500bbf0eae9eb11af0bd4f</Sha>
299299
<SourceBuild RepoName="razor" ManagedOnly="true" />
300300
</Dependency>
301-
<Dependency Name="Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal" Version="7.0.0-preview.24523.2">
301+
<Dependency Name="Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal" Version="7.0.0-preview.24565.5">
302302
<Uri>https://github.com/dotnet/razor</Uri>
303-
<Sha>5161ec13b0ed670b69f3fe5b2c57f239ce63c28e</Sha>
303+
<Sha>aa2c76f75e60f3f6ae500bbf0eae9eb11af0bd4f</Sha>
304304
</Dependency>
305-
<Dependency Name="Microsoft.NET.Sdk.Razor.SourceGenerators.Transport" Version="7.0.0-preview.24523.2">
305+
<Dependency Name="Microsoft.NET.Sdk.Razor.SourceGenerators.Transport" Version="7.0.0-preview.24565.5">
306306
<Uri>https://github.com/dotnet/razor</Uri>
307-
<Sha>5161ec13b0ed670b69f3fe5b2c57f239ce63c28e</Sha>
307+
<Sha>aa2c76f75e60f3f6ae500bbf0eae9eb11af0bd4f</Sha>
308308
</Dependency>
309309
<Dependency Name="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.11">
310310
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore</Uri>

eng/Versions.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@
179179
</PropertyGroup>
180180
<!-- Dependencies from https://github.com/dotnet/razor -->
181181
<PropertyGroup>
182-
<MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>7.0.0-preview.24523.2</MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>
183-
<MicrosoftCodeAnalysisRazorToolingInternalVersion>7.0.0-preview.24523.2</MicrosoftCodeAnalysisRazorToolingInternalVersion>
184-
<MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>7.0.0-preview.24523.2</MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>
182+
<MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>7.0.0-preview.24565.5</MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>
183+
<MicrosoftCodeAnalysisRazorToolingInternalVersion>7.0.0-preview.24565.5</MicrosoftCodeAnalysisRazorToolingInternalVersion>
184+
<MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>7.0.0-preview.24565.5</MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>
185185
</PropertyGroup>
186186
<PropertyGroup>
187187
<!-- Dependencies from https://github.com/dotnet/wpf -->

src/Cli/dotnet/commands/dotnet-workload/list/VisualStudioWorkloads.cs

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ namespace Microsoft.DotNet.Workloads.Workload
2020
#endif
2121
internal static class VisualStudioWorkloads
2222
{
23+
private static readonly object s_guard = new();
24+
2325
private const int REGDB_E_CLASSNOTREG = unchecked((int)0x80040154);
2426

2527
/// <summary>
@@ -158,44 +160,50 @@ internal static void WriteSDKInstallRecordsForVSWorkloads(IInstaller workloadIns
158160
/// <returns>A list of Visual Studio instances.</returns>
159161
private static List<ISetupInstance> GetVisualStudioInstances()
160162
{
161-
List<ISetupInstance> vsInstances = new();
162-
163-
try
163+
// The underlying COM API has a bug where-by it's not safe for concurrent calls. Until their
164+
// bug fix is rolled out use a lock to ensure we don't concurrently access this API.
165+
// https://dev.azure.com/devdiv/DevDiv/_workitems/edit/2241752/
166+
lock (s_guard)
164167
{
165-
SetupConfiguration setupConfiguration = new();
166-
ISetupConfiguration2 setupConfiguration2 = setupConfiguration;
167-
IEnumSetupInstances setupInstances = setupConfiguration2.EnumInstances();
168-
ISetupInstance[] instances = new ISetupInstance[1];
169-
int fetched = 0;
168+
List<ISetupInstance> vsInstances = new();
170169

171-
do
170+
try
172171
{
173-
setupInstances.Next(1, instances, out fetched);
172+
SetupConfiguration setupConfiguration = new();
173+
ISetupConfiguration2 setupConfiguration2 = setupConfiguration;
174+
IEnumSetupInstances setupInstances = setupConfiguration2.EnumInstances();
175+
ISetupInstance[] instances = new ISetupInstance[1];
176+
int fetched = 0;
174177

175-
if (fetched > 0)
178+
do
176179
{
177-
ISetupInstance2 instance = (ISetupInstance2)instances[0];
180+
setupInstances.Next(1, instances, out fetched);
178181

179-
// .NET Workloads only shipped in 17.0 and later and we should only look at IDE based SKUs
180-
// such as community, professional, and enterprise.
181-
if (Version.TryParse(instance.GetInstallationVersion(), out Version version) &&
182-
version.Major >= 17 &&
183-
s_visualStudioProducts.Contains(instance.GetProduct().GetId()))
182+
if (fetched > 0)
184183
{
185-
vsInstances.Add(instances[0]);
184+
ISetupInstance2 instance = (ISetupInstance2)instances[0];
185+
186+
// .NET Workloads only shipped in 17.0 and later and we should only look at IDE based SKUs
187+
// such as community, professional, and enterprise.
188+
if (Version.TryParse(instance.GetInstallationVersion(), out Version version) &&
189+
version.Major >= 17 &&
190+
s_visualStudioProducts.Contains(instance.GetProduct().GetId()))
191+
{
192+
vsInstances.Add(instances[0]);
193+
}
186194
}
187195
}
196+
while (fetched > 0);
197+
198+
}
199+
catch (COMException e) when (e.ErrorCode == REGDB_E_CLASSNOTREG)
200+
{
201+
// Query API not registered, good indication there are no VS installations of 15.0 or later.
202+
// Other exceptions are passed through since that likely points to a real error.
188203
}
189-
while (fetched > 0);
190204

205+
return vsInstances;
191206
}
192-
catch (COMException e) when (e.ErrorCode == REGDB_E_CLASSNOTREG)
193-
{
194-
// Query API not registered, good indication there are no VS installations of 15.0 or later.
195-
// Other exceptions are passed through since that likely points to a real error.
196-
}
197-
198-
return vsInstances;
199207
}
200208
}
201209
}

0 commit comments

Comments
 (0)