How I install and updateVisualStudio 2022 with an offline installer for ASP.NET CORE

Bjego
2 min readAug 1, 2022

--

My corporate decided that people should have 2 accounts one account for their personal doings and one with admin grants, but without internet access. Because of this I have to create an offline installation image for my VisualStudio 2022 instance and install this local version as an administrator.

Download the latest installer “vs_professional.exe” from the docs

You can easily download the latest VS install clis from the official docs for offline installations. In my case I am using VS_PROFESSIONAL and stored it in C:\VisualStudio

https://docs.microsoft.com/en-us/visualstudio/install/create-an-offline-installation-of-visual-studio?view=vs-2022#step-1---download-the-visual-studio-bootstrapper

Download the “image” for ASP.NET Core

I am using Powershell in the context of my normal user to download the contents of Visual Studio. The image should be stored in C:\VisualStudio\Layout. Therefore I navigate to C:\VisualStudio with Powershell and run:

./vs_Professional.exe --layout c:\VisualStudio\Layout --add Microsoft.VisualStudio.Workload.NetWeb --includeOptional --lang en-US

The proxy configuration will be pulled from your useraccount, so you don’t have to deal with it. The download will spawn a “Visual Studio” installer window and then a console window which downloads all those files.

Install the image as an admin

Well for the installation I have to run an admin powershell console, navigate again to C:\VisualStudio and run the vs_professional.exe file from the subfolder “Layout” which was created earlier

./Layout/vs_Professional.exe --noweb --add Microsoft.VisualStudio.Workload.NetWeb --includeOptional

This command again launches the Visual Studio Installer GUI. Everything is already prefonfigured and you just have to click on “Install” or “Update” at the bottom of the window

Further readings and information:

All workloads in detail with their cli ids:

These IDs are pretty handy, if you need more / other components.

Official docs:

My source for actually writing and doing this.

Have a nice week — I’ll update my VS now..

--

--

No responses yet