Unclear why this happened for my installation, but Visual Studio (VS 2022 preview at this time) had an offline location (good), but no package source to nuget.
This caused my build to fail on packages not found in the offline directory.
Hence I ended up adding a Package source in Visual Studio for Nuget as:
nuget.org
https://api.nuget.org/v3/index.json
Which then allowed VS to do a Restore of packages to succeed.
So, I did not have to do a nuget install Newtonsoft.json -source ... type command on each failed package, as mentioned in other posts.
Unclear why this happened for my installation, but Visual Studio (VS 2022 preview at this time) had an offline location (good), but no package source to nuget.
This caused my build to fail on packages not found in the offline directory.
Hence I ended up adding a Package source in Visual Studio for Nuget as:
nuget.org
https://api.nuget.org/v3/index.json
Which then allowed VS to do a Restore of packages to succeed.
So, I did not have to do a nuget install Newtonsoft.json -source ... type command on each failed package, as mentioned in other posts.
Visual Studio provides some common packages for us to use in the Microsoft SDKs\NuGetPackages folder when our computer doesn't have network.
The C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\ folder is not means that the cache for the packages has been installed before from internet. So the package ProductionStackTrace will not add into this folder.
If you want to use this package without network, you need to download it when you have network. You can download it from the nuget.org.
Certainly, you can also add this package in to the Microsoft SDKs\NuGetPackages so that you can use it when you do not have a network. The add command line is:
nuget add <packagePath> -source <sourcePath> [options]
You can refer to the nuget Add reference for detail.
Hope this can help you.
Videos
I was thinking of making an offline installer for Visual Studio 2017 and I was successful in doing that. But, it downloaded everything and it was around 20 GB, which is just too much.
Is there any way to download only selected components/Packages for VS 2017 offline? I just want to use VS for C# development and with Xamarin for Android dev. Any suggestions?
Please don't down-vote for no reason.
EDIT:
Found a command on SO which should get me basic stuff for Xamarin and Android dev and C#.
vs_community__198857855.1490528169.exe --layout "C:\vs2017" -add Microsoft.VisualStudio.Workload.NetCrossPlat -add Microsoft.VisualStudio.Workload.ManagedDesktop -add Microsoft.VisualStudio.Workload.NetCoreTools --lang en-US
I haven't tested if it downloaded everything or not. Will share if it works perfectly. But, please do share some more info if you something new :D
Hi @Rod Falanga
Welcome to Microsoft Q&A!
Does the Entity Framework Core you mentioned refer to this Nuget package? I can install it in Visual Studio, can you provide more information?
- Update:
What package source did you choose? Did you choose nuget.org?
Please make sure you have selected the correct package source, you can upload a screenshot of the nuget solution manager.

- Update:
If your Visual Studio package source does not have nuget.org, you can try to add it to the package source.
Name:
nuget.org
Source:
https://api.nuget.org/v3/index.json

Sincerely,
Peng
*
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread
This was helpful, thank you very much'
If you want to do an offline update from VS17.12 to 17.13 , you can follow below steps:
- Update the layout to a specific version of the product.
- Go to the Visual Studio 2022 Release History page and download a particular fixed version bootstrapper(e.g vs_Enterprise17.13.0), copy it into your layout, and use it to update the layout to that exact version specified in the bootstrapper.
- Run the --layout command in an elevated prompt to download the latest packages into your layout.
vs_enterprise.exe --layout c:\VSLayout
- Update your Visual Studio 2022 by running the Visual Studio Installer > Update or you can also use the following command:
vs_enterprise.exe update --noWeb --quiet --installpath "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
Update
The easiest and fastest way to update your offline Visual Studio instances: using a minimal offline layout.
Do i have to download the entire VS Layout package everytime if there is an version update?
Unlike a full Visual Studio layout, a minimal layout only contains the updated packages, so it is always smaller and faster to generate and deploy.
1.Generating a minimal layout.
MinimalLayout.exe generate --targetLocation c:\VSLayout\ --productIds Microsoft.VisualStudio.Product.Enterprise --baseVersion 17.12.5 --targetVersion 17.13.0 --languages en-US
2.Update the Visual Studio Installer
vs_enterprise.exe --quiet --update --offline C:\VSLayout\vs_installer.opc
3.Update the Visual Studio application
vs_enterprise.exe update --noWeb --quiet --installpath "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
Docs Referred:
Update the layout to a specific version of the product
Update Visual Studio from a layout
Microsoft has a handy post that details what you need to do. Essentially, at the command line on the computer with internet access, execute:
vs_enterprise.exe --layout c:\localVSlayout
Replace c:\localVsLayout with where you want to dump the files. It's going to be big! You may need to change vs_enterprise.exe with the correct executable name for your version of Visual Studio.
Hi Billy,
Thank you for contacting us.
Regarding your concern, please note that Microsoft enforces activation per machine to prevent piracy and ensure compliance. You can still install Visual Studio Professional offline, but it requires manual product key entry or volume license setup, not a universal multi-access key. Below are the steps you should take:
- You first need to install Visual Studio online
- Create a layout for offline install, you can check this link for more specific guidance
- Manually download and install missing certificate:
- Download the certificate: http://www.microsoft.com/pkiops/certs/Microsoft%20Windows%20Code%20Signing%20PCA%202024.crt
- Double-click the .crt file to open the Certificate window.
- Click “Install Certificate…”
- Choose “Local Machine” (you may need admin rights).
- Select “Place all certificates in the following store”
- Click “Browse…” and choose: Trusted Root Certification Authorities. Click Next, then Finish.
- Copy the layout folder that you have just created to your offline device and run this command in the layout folder
→ Visual Studio Professional 2022 will be install offlinevs_professional.exe --noweb - Go to Help → About Visual Studio → License Status → Click Unlock with a Product Key. Enter the Product Key and click Apply
- Visual Studio creates a request file containing your installation ID. Save this file and transfer it to an internet-accessed device.
- On a device with internet access, go to the Microsoft Licensing Activation site (provided in the Visual Studio activation dialog) → Upload the request file → Microsoft will generate a response file then transfer the response file back to the offline machine.
- In Visual Studio’s activation dialog, select Use Response File → Browse to the file and apply it → Visual Studio will confirm activation.
I hope that these instructions will be helpful! If you have any other questions, feel free to reach out, I'm here to help.
Happy holiday!
Yes, Visual Studio can be installed on an offline PC. To do this, you need to create an offline installer using the Visual Studio installer on a machine with internet access. You can follow these steps:
- Download the Visual Studio installer from the Visual Studio page.
- Use the command line to create an offline installer layout. For example:
"vs_professional.exe" --LayOut "C:\Temp\VS2022Offline" --Lang "en-US" - Copy the created offline installer folder to the target offline machine.
- Run the installer from the copied folder using an administrator command prompt.
- Follow the setup wizard to complete the installation.
Additionally, Visual Studio Professional and Enterprise editions support offline activation via a product key, while Visual Studio Community does not support offline activation.
References:
- Set up Visual Studio on an offline machine
- Install certificates required for Visual Studio offline installation
- SSIS Projects extension for Visual Studio 2022+ troubleshooting guide
Hi @Mehdi Khaleghian | MOQdigital ,
Apologies for the delayed response. Can you please follow the steps below and see if it resolves this issue?
- Open Visual Studio, go to "Debug" --> "Options.."
- Search for "Nuget Package Manager" --> General
- Click on "Clear All Nuget Cache(s)" and wait for it to clear. (If it throws error, please note the error, and close all running instance of Visual Studio/applications that might be using the package manager). This would ensure that the local cache is cleared properly. You may get more details of caches being cleared by looking into "Output" window after performing this step.
- After the step above completes, go to "Debug" --> "Options.." again.
- Under "Nuget Package Manager" --> Package Sources. Make a copy of the sources available there (Name and URL) in notepad. (This should help get rid of any non-printable characters which might be present in the copied string)
- Delete all sources and click "OK". (This is to ensure that removal gets persisted, in case there was an error saving the sources originally due to non-visible characters etc.)
- After the step above completes, go to "Debug" --> "Options.." again.
- Under "Nuget Package Manager" --> "Package Sources", add the sources with details from notepad copied in step 5 above.
- Click on "OK"
Check if you can build the project successfully.
In addition to the steps mentioned above, please ensure that "ASP.NET and web development" and "Azure Development" workloads are installed for this instance of Visual Studio. You can verify it by
- "Start" --> "Visual Studio Installed"
- Locate your version of VS in here (16.11.3) --> click on "Modify". If the above 2 workloads are not present, please select them and install.
In case you still run in to similar issues, you may try running dotnet restore with detailed verbosity (-v d parameter) to examine the error details. More details available here. Please let me know if you have any questions.
Please 'Accept as answer' if it helped so that it can help others in the community looking for help on similar topics.
The only problem I had with this is that the TargetFramework version in the example I downloaded was net8.0 in the .csproj file. I just had to change that to the version I was actually running net10.0, and everything worked fine.
I wan't to make an offline installer of visual studio community 2022 and put that on a usb stick and install it on a friend's laptop. Is it possible? And if so how?