Skip to content

Remove Default NgenArchitecture #15749

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

Conversation

AlexDelepine
Copy link
Contributor

@AlexDelepine AlexDelepine commented Apr 15, 2025

Default NgenArchitecture being set to "All" causes VS to produce NGEN images for 32-bit products that don't exist, it causes 32-bit NGEN images to be created despite there being no 32-bit version of VS.

To double check:

Remove default NgenArchitecture to allow 64-bit default to be used without generating unnecessary 32-bit images for 64-bit apps.
@tmat
Copy link
Member

tmat commented Apr 18, 2025

If NgenArchitecture is not specified will VS default to all supported architectures?

@AlexDelepine
Copy link
Contributor Author

AlexDelepine commented Apr 18, 2025

@tmat If no NgenArchitecture is specified, VS will default to ngen using the product architecture will be 64-bit.

@ericstj ericstj requested review from tmat and jasonmalinowski April 21, 2025 16:19
@tmat
Copy link
Member

tmat commented Apr 21, 2025

In that case this project reference needs to be updated to set the architecture to 32 bit before we change the defaults:

https://github.com/dotnet/roslyn/blob/main/src/VisualStudio/Setup/Roslyn.VisualStudio.Setup.csproj#L313

@jasonmalinowski
Copy link
Member

@tmat: I imagine this was already broken -- would that property have applied to stuff coming through a project reference anyways?

@jasonmalinowski
Copy link
Member

@davkean
Copy link
Member

davkean commented Apr 21, 2025

@tmat @jasonmalinowski This NGEN's InteractiveHost32.exe here: https://github.com/dotnet/roslyn/blob/024254813274b5e545585a73b766203c5d979dd7/src/Interactive/HostProcess/x86/InteractiveHost32.csproj#L27-L38 and according to NGEN logs, this is working; I don't see it show up in 64-bit logs, but I do see it show up in 32-bit logs. It's also passing the correct binding exe config (the 64-bit one for dependencies as called out in the code):

04/21/2025 18:28:34.801 [2208]: Executing command from offline queue: install "C:\VisualStudio\Common7\IDE\CommonExtensions\Microsoft\VBCSharp\LanguageServices\InteractiveHost\Desktop\Microsoft.NET.StringTools.dll" /NoDependencies /ExeConfig:"C:\VisualStudio\Common7\IDE\CommonExtensions\Microsoft\VBCSharp\LanguageServices\InteractiveHost\Desktop\InteractiveHost64.exe" /queue:3

Do note that the exe itself passes itself as the host:

04/21/2025 18:28:34.799 [2208]: Executing command from offline queue: install "C:\VisualStudio\Common7\IDE\CommonExtensions\Microsoft\VBCSharp\LanguageServices\InteractiveHost\Desktop\InteractiveHost32.exe" /NoDependencies /ExeConfig:"C:\VisualStudio\Common7\IDE\CommonExtensions\Microsoft\VBCSharp\LanguageServices\InteractiveHost\Desktop\InteractiveHost32.exe" /queue:3

@davkean
Copy link
Member

davkean commented Apr 21, 2025

Actually I'm wrong, misread the code. I'm not super convinced that 32-bit project code is doing anything other than NGEN'ing itself.

The 64-bit seems to NGEN all the dependencies for both 32-bit and 64-bit and the logs seem to indicate that. I think this change will not break that step.

@jasonmalinowski
Copy link
Member

@davkean Ah yes, looks good then and I think this is good to merge.

@davkean davkean merged commit 11bac6e into dotnet:main Apr 22, 2025
11 checks passed
@AlexDelepine AlexDelepine deleted the dev/alexdelepine/RemoveDefaultNgenArchitecture branch April 22, 2025 17:57
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.

4 participants