Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot enumerate VS workloads on ARM64 (exception in dotnet --info) #31552

Open
sblom opened this issue Mar 28, 2023 · 7 comments
Open

Cannot enumerate VS workloads on ARM64 (exception in dotnet --info) #31552

sblom opened this issue Mar 28, 2023 · 7 comments
Assignees
Labels
Area-Workloads untriaged Request triage from a team member

Comments

@sblom
Copy link

sblom commented Mar 28, 2023

Description

When I run dotnet --info on ARM64, I see an exception reported in the ".NET workloads installed:" section.

2023-03-28T12:51:38.3237539Z [05:51:38] Executing command: D:\agent\_work\1\s/artifacts/out\sdk\a64\dotnet.exe --info
2023-03-28T12:51:41.7432919Z .NET SDK:
2023-03-28T12:51:41.7434619Z  Version:   8.0.100-preview.4.23178.2
2023-03-28T12:51:41.7435737Z  Commit:    69e28735b9
2023-03-28T12:51:41.7439641Z 
2023-03-28T12:51:41.7440492Z Runtime Environment:
2023-03-28T12:51:41.7630407Z  OS Name:     Windows
2023-03-28T12:51:41.7631930Z  OS Version:  10.0.25124
2023-03-28T12:51:41.8878125Z  OS Platform: Windows
2023-03-28T12:51:42.2820047Z  RID:         win10-arm64
2023-03-28T12:51:42.2821560Z  Base Path:   D:\agent\_work\1\s\artifacts\out\sdk\a64\sdk\8.0.100-preview.4.23178.2\
2023-03-28T12:51:42.2822263Z 
2023-03-28T12:51:42.2824704Z .NET workloads installed:
2023-03-28T12:51:43.6104373Z System.BadImageFormatException: Retrieving the COM class factory for component with CLSID {177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D} failed due to the following error: 800700c1  is not a valid Win32 application. (0x800700C1).
2023-03-28T12:51:43.6107137Z    at System.RuntimeTypeHandle.AllocateComObject(Void* pClassFactory)
2023-03-28T12:51:43.6108797Z    at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
2023-03-28T12:51:43.6110303Z    at Microsoft.DotNet.Workloads.Workload.VisualStudioWorkloads.GetVisualStudioInstances()
2023-03-28T12:51:43.6112107Z    at Microsoft.DotNet.Workloads.Workload.VisualStudioWorkloads.GetInstalledWorkloads(IWorkloadResolver workloadResolver, InstalledWorkloadsCollection installedWorkloads, Nullable`1 sdkFeatureBand)
2023-03-28T12:51:43.6114059Z    at Microsoft.DotNet.Workloads.Workload.List.WorkloadInfoHelper.AddInstalledVsWorkloads(IEnumerable`1 sdkWorkloadIds)
2023-03-28T12:51:43.6116528Z    at Microsoft.DotNet.Cli.WorkloadCommandParser.ShowWorkloadsInfo(ParseResult parseResult, IWorkloadInfoHelper workloadInfoHelper, IReporter reporter, String dotnetDir)
2023-03-28T12:51:43.6118079Z    at Microsoft.DotNet.Cli.CommandLineInfo.PrintInfo()
2023-03-28T12:51:43.6119496Z    at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)
2023-03-28T12:51:43.6120800Z    at Microsoft.DotNet.Cli.Program.Main(String[] args)
2023-03-28T12:51:43.6251950Z 
2023-03-28T12:51:43.6254933Z Host:
2023-03-28T12:51:43.6256157Z   Version:      8.0.0-preview.4.23176.4
2023-03-28T12:51:43.6257013Z   Architecture: arm64
2023-03-28T12:51:43.6257807Z   Commit:       8d5f520838
2023-03-28T12:51:43.6258217Z 
2023-03-28T12:51:43.6259197Z .NET SDKs installed:
2023-03-28T12:51:43.6260140Z   8.0.100-preview.4.23178.2 [D:\agent\_work\1\s\artifacts\out\sdk\a64\sdk]
2023-03-28T12:51:43.6260679Z 
2023-03-28T12:51:43.6261395Z .NET runtimes installed:
2023-03-28T12:51:43.6262677Z   Microsoft.AspNetCore.App 8.0.0-preview.4.23176.6 [D:\agent\_work\1\s\artifacts\out\sdk\a64\shared\Microsoft.AspNetCore.App]
2023-03-28T12:51:43.6264167Z   Microsoft.NETCore.App 8.0.0-preview.4.23176.4 [D:\agent\_work\1\s\artifacts\out\sdk\a64\shared\Microsoft.NETCore.App]
2023-03-28T12:51:43.6265648Z   Microsoft.WindowsDesktop.App 8.0.0-preview.4.23175.4 [D:\agent\_work\1\s\artifacts\out\sdk\a64\shared\Microsoft.WindowsDesktop.App]
2023-03-28T12:51:43.6266431Z 
2023-03-28T12:51:43.6267080Z Other architectures found:
2023-03-28T12:51:43.6267809Z   None
2023-03-28T12:51:43.6268101Z 
2023-03-28T12:51:43.6268773Z Environment variables:
2023-03-28T12:51:43.6269462Z   Not set
2023-03-28T12:51:43.6269747Z 
2023-03-28T12:51:43.6270407Z global.json file:
2023-03-28T12:51:43.6271070Z   Not found
2023-03-28T12:51:43.6271387Z 
2023-03-28T12:51:43.6272003Z Learn more:
2023-03-28T12:51:43.6272715Z   https://aka.ms/dotnet/info
2023-03-28T12:51:43.6273076Z 
2023-03-28T12:51:43.6273748Z Download .NET:
2023-03-28T12:51:43.6274507Z   https://aka.ms/dotnet/download

Reproduction Steps

Invoke dotnet --info on an ARM64 machine. Appears to be new in 8.0-preview3.

Expected behavior

No exception. Maybe no workload readout on ARM64 hardware if we don't expect that to work?

Actual behavior

Exception is reported in the ".NET workloads installed:" section of dotnet --info output.

System.BadImageFormatException: Retrieving the COM class factory for component with CLSID {177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D} failed due to the following error: 800700c1 is not a valid Win32 application. (0x800700C1).

This CLSID appears to be related to the Visual Studio installer, and is probably being used to report some information about VS workloads installed on the machine.

(Full stack trace in issue description above.)

Regression?

As far as I can tell, this worked in 8.0-preview2 and before.

Known Workarounds

No response

Configuration

.NET 8.0 Preview 4
ARM64

Other information

No response

@ghost ghost added the untriaged Request triage from a team member label Mar 28, 2023
@steveisok steveisok transferred this issue from dotnet/runtime Mar 30, 2023
@baronfel
Copy link
Member

baronfel commented Apr 4, 2023

@joeloff do we have to do VS probing differently on arm64?

@joeloff
Copy link
Member

joeloff commented Apr 4, 2023

No, this is related to older VS versions not targeting the arm64 vc libraries, so it fails to instantiate the COM object. VS has fixed this, but on machines that run into this, you need to install the vcredist to work around the issue.

@baronfel
Copy link
Member

baronfel commented Apr 4, 2023

Is there anything we can/should do in terms of error messages here to clue users into this? At minimum can we catch this failure mode and link to the vcredist or something?

@joeloff
Copy link
Member

joeloff commented Apr 4, 2023

I suppose we could. The fix was made for 17.5 because the update in 17.4 was still low for arm64. We'd be special casing this exception/error code/platform and it will fail for any list command in every sdk where we enabled interaction with VS potentially, so you'd have to port the fix to 7.0.1xx and later.

@joeloff
Copy link
Member

joeloff commented Apr 11, 2023

I dug up the original error I ran into. Same class ID, but different error message

Retrieving the COM class factory for component with CLSID {177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D} failed due to the following error: 8007007e The specified module could not be found.

@sblom
Copy link
Author

sblom commented Apr 11, 2023

Looks like the VS install on this machine is 16.11 (no VS 2022 at all).

I also have these VCRedist packages (the hope was that the highlighted one would fix this):
image

I admit that running net8.0 on ARM64 machine with only pre-ARM VS might be an, umm, rare use case.

@sblom
Copy link
Author

sblom commented Apr 13, 2023

Installing VS 17.5 fixed this entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Workloads untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

3 participants