0

I have a virtual machine that does not have internet enabled. When running dotnet build, I get the following error:

Unable to load the service index for source https://api.nuget.org/v3/index.json.

Is it possible to build and run a .NET Core project offline?

crayden
  • 2,130
  • 6
  • 36
  • 65
  • Possible duplicate of [How do you set up for offline development with .net Core](https://stackoverflow.com/questions/37338899/how-do-you-set-up-for-offline-development-with-net-core) – jmoerdyk Jul 15 '19 at 18:59

2 Answers2

0

Yes. But it requires you to already have all dependencies at hand. E.g. having run the dotnet restore command prior to going offline, or install the requirements from the .csproj file by hand.

I suggest looking here for a solution

rasmus91
  • 3,024
  • 3
  • 20
  • 32
0

Nuget is an online repository for .net libraries referenced in your projects.

Instead of referencing via nuget online you could pre-download the packages and have them referenced locally. see: How do I install a NuGet package .nupkg file locally?

You would also need to reference any JavaScript libraries locally instead of using CDN's, which would require an internet connection.

Mark Redman
  • 24,079
  • 20
  • 92
  • 147