Skip to content

Commit

Permalink
[release/8.0.3xx] Update dependencies from dotnet/razor (#44904)
Browse files Browse the repository at this point in the history
  • Loading branch information
joeloff authored Nov 19, 2024
2 parents 716c6b6 + 7fb5f08 commit 3011043
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 35 deletions.
12 changes: 6 additions & 6 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -293,18 +293,18 @@
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore</Uri>
<Sha>47576478939fdd59b4400ad135f47938af486ab3</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Razor.Tooling.Internal" Version="7.0.0-preview.24523.2">
<Dependency Name="Microsoft.CodeAnalysis.Razor.Tooling.Internal" Version="7.0.0-preview.24565.5">
<Uri>https://github.com/dotnet/razor</Uri>
<Sha>5161ec13b0ed670b69f3fe5b2c57f239ce63c28e</Sha>
<Sha>aa2c76f75e60f3f6ae500bbf0eae9eb11af0bd4f</Sha>
<SourceBuild RepoName="razor" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal" Version="7.0.0-preview.24523.2">
<Dependency Name="Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal" Version="7.0.0-preview.24565.5">
<Uri>https://github.com/dotnet/razor</Uri>
<Sha>5161ec13b0ed670b69f3fe5b2c57f239ce63c28e</Sha>
<Sha>aa2c76f75e60f3f6ae500bbf0eae9eb11af0bd4f</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Sdk.Razor.SourceGenerators.Transport" Version="7.0.0-preview.24523.2">
<Dependency Name="Microsoft.NET.Sdk.Razor.SourceGenerators.Transport" Version="7.0.0-preview.24565.5">
<Uri>https://github.com/dotnet/razor</Uri>
<Sha>5161ec13b0ed670b69f3fe5b2c57f239ce63c28e</Sha>
<Sha>aa2c76f75e60f3f6ae500bbf0eae9eb11af0bd4f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.11">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore</Uri>
Expand Down
6 changes: 3 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@
</PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/razor -->
<PropertyGroup>
<MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>7.0.0-preview.24523.2</MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>
<MicrosoftCodeAnalysisRazorToolingInternalVersion>7.0.0-preview.24523.2</MicrosoftCodeAnalysisRazorToolingInternalVersion>
<MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>7.0.0-preview.24523.2</MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>
<MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>7.0.0-preview.24565.5</MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>
<MicrosoftCodeAnalysisRazorToolingInternalVersion>7.0.0-preview.24565.5</MicrosoftCodeAnalysisRazorToolingInternalVersion>
<MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>7.0.0-preview.24565.5</MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/wpf -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ namespace Microsoft.DotNet.Workloads.Workload
#endif
internal static class VisualStudioWorkloads
{
private static readonly object s_guard = new();

private const int REGDB_E_CLASSNOTREG = unchecked((int)0x80040154);

/// <summary>
Expand Down Expand Up @@ -158,44 +160,50 @@ internal static void WriteSDKInstallRecordsForVSWorkloads(IInstaller workloadIns
/// <returns>A list of Visual Studio instances.</returns>
private static List<ISetupInstance> GetVisualStudioInstances()
{
List<ISetupInstance> vsInstances = new();

try
// The underlying COM API has a bug where-by it's not safe for concurrent calls. Until their
// bug fix is rolled out use a lock to ensure we don't concurrently access this API.
// https://dev.azure.com/devdiv/DevDiv/_workitems/edit/2241752/
lock (s_guard)
{
SetupConfiguration setupConfiguration = new();
ISetupConfiguration2 setupConfiguration2 = setupConfiguration;
IEnumSetupInstances setupInstances = setupConfiguration2.EnumInstances();
ISetupInstance[] instances = new ISetupInstance[1];
int fetched = 0;
List<ISetupInstance> vsInstances = new();

do
try
{
setupInstances.Next(1, instances, out fetched);
SetupConfiguration setupConfiguration = new();
ISetupConfiguration2 setupConfiguration2 = setupConfiguration;
IEnumSetupInstances setupInstances = setupConfiguration2.EnumInstances();
ISetupInstance[] instances = new ISetupInstance[1];
int fetched = 0;

if (fetched > 0)
do
{
ISetupInstance2 instance = (ISetupInstance2)instances[0];
setupInstances.Next(1, instances, out fetched);

// .NET Workloads only shipped in 17.0 and later and we should only look at IDE based SKUs
// such as community, professional, and enterprise.
if (Version.TryParse(instance.GetInstallationVersion(), out Version version) &&
version.Major >= 17 &&
s_visualStudioProducts.Contains(instance.GetProduct().GetId()))
if (fetched > 0)
{
vsInstances.Add(instances[0]);
ISetupInstance2 instance = (ISetupInstance2)instances[0];

// .NET Workloads only shipped in 17.0 and later and we should only look at IDE based SKUs
// such as community, professional, and enterprise.
if (Version.TryParse(instance.GetInstallationVersion(), out Version version) &&
version.Major >= 17 &&
s_visualStudioProducts.Contains(instance.GetProduct().GetId()))
{
vsInstances.Add(instances[0]);
}
}
}
while (fetched > 0);

}
catch (COMException e) when (e.ErrorCode == REGDB_E_CLASSNOTREG)
{
// Query API not registered, good indication there are no VS installations of 15.0 or later.
// Other exceptions are passed through since that likely points to a real error.
}
while (fetched > 0);

return vsInstances;
}
catch (COMException e) when (e.ErrorCode == REGDB_E_CLASSNOTREG)
{
// Query API not registered, good indication there are no VS installations of 15.0 or later.
// Other exceptions are passed through since that likely points to a real error.
}

return vsInstances;
}
}
}

0 comments on commit 3011043

Please sign in to comment.