I found a possible solution for getting specific version of VS 2022 Community, even with generating offline layout.
- Go to Microsoft’s Visual Studio 2022 Release History page and scroll down to Fixed version bootstrappers.
- Choose any LTSC version you’d want to install. For example, in my case I wanted to get 17.10.17, then download “Professional” bootstrapper. You’ll get a
vs_Professional.exe, but don’t worry, it will work for Community too! - Make a batch file, name it to for example
get_layout.cmd, open it in any text editor, and put the layout generation command there. My command was:
vs_professional.exe --layout ".\layout" --lang en-US --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NetWeb --add Microsoft.NetCore.Component.Runtime.6.0 --add microsoft.net.runtime.mono.tooling.net6 --add wasm.tools.net6 --add Microsoft.Net.Component.3.5.DeveloperTools ---add Microsoft.VisualStudio.Component.LinqToSql --add Microsoft.Net.Component.4.6.2.TargetingPack --add Microsoft.Net.ComponentGroup.4.6.2-4.7.1.DeveloperTools --add Microsoft.VisualStudio.Component.AspNet --add Microsoft.VisualStudio.Component.AspNet45 --add Microsoft.VisualStudio.Component.Wcf.Tooling --add Microsoft.VisualStudio.ComponentGroup.AdditionalWebProjectTemplates --add Microsoft.VisualStudio.ComponentGroup.IISDevelopment --add Microsoft.VisualStudio.Web.Mvc4.ComponentGroup --includeRecommended --includeOptional
You can choose any workloads listed on the Visual Studio Component directory page. Some workloads or components might not work on newer or older versions.
- Run the batch file, which will create a local layout for the version you had chosen.
- After the local layout was created, enter to layout directory, open
Layout.jsonandResponse.jsonfiles in any text editor. Find this part:"productId": "Microsoft.VisualStudio.Product.Professional"in these files, replace it to"productId": "Microsoft.VisualStudio.Product.Community", then save the files. - Create another batch file in the layout directory with the next parameters, and all workloads and components which was put into the layout generator batch file:
vs_setup.exe --installCatalogUri %~dp0Catalog.json --installChannelUri %~dp0ChannelManifest.json --noUpdateInstaller --channelId VisualStudio.17.Release.LTSC.17.10 --productId Microsoft.VisualStudio.Product.Community --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NetWeb --add Microsoft.NetCore.Component.Runtime.6.0 --add microsoft.net.runtime.mono.tooling.net6 --add wasm.tools.net6 --add Microsoft.Net.Component.3.5.DeveloperTools ---add Microsoft.VisualStudio.Component.LinqToSql --add Microsoft.Net.Component.4.6.2.TargetingPack --add Microsoft.Net.ComponentGroup.4.6.2-4.7.1.DeveloperTools --add Microsoft.VisualStudio.Component.AspNet --add Microsoft.VisualStudio.Component.AspNet45 --add Microsoft.VisualStudio.Component.Wcf.Tooling --add Microsoft.VisualStudio.ComponentGroup.AdditionalWebProjectTemplates --add Microsoft.VisualStudio.ComponentGroup.IISDevelopment --add Microsoft.VisualStudio.Web.Mvc4.ComponentGroup --includeRecommended --includeOptional --noWeb --nocache
The most important arguments are:
- –installCatalogUri %~dp0Catalog.json (forces installer to use Catalog.json form the local layout)
- –installChannelUri %~dp0ChannelManifest.json (forces installer to use ChannelManifest.json form the local layout)
- –noUpdateInstaller (disallowing installer to be updated to the latest version)
- –channelId VisualStudio.17.Release.LTSC.17.10 (forcing channel id., this might change to version you’d like to install)
- –productId Microsoft.VisualStudio.Product.Community (forcing product id. to Community edition instead of professional)
- –noWeb (forcing installer to use install only from downloaded packages)
- –nocache (forcing installer not to create a local cache – less disk space used, because you already have the packages in the local layout directory)
- Start the newly created batch file, and you’ll see an installer starting, displaying the older version you’d like to install.
Choose the components you’d like to install, and wait for it finishes. - (optional step) .NET SDK’s will be older than the latest available, so I recommend downloading the latest version from https://dotnet.microsoft.com/en-us/download/dotnet