0
votes

When I try to build my Visual Studio 2019, VB.Net solution, I get the following:

An error occurred while trying to restore packages: Unable to find version '15.0.4795.1000' of package 'Microsoft.Office.Interop.'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages: Package 'Microsoft.Office.Interop..15.0.4795.1000' is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'. https://api.nuget.org/v3/index.json: Package 'Microsoft.Office.Interop..15.0.4795.1000' is not found on source 'https://api.nuget.org/v3/index.json'.

I've gone into the NuGet manager, done a browse for "Microsoft.Office.Interop" and it shows that version as the latest stable version for ".Excel". When I try to do an install or a restore, I just get the same error.

When I browse the application folders, I see the .dll, but obviously something is missing somewhere. Any ideas?

1

1 Answers

1
votes

I tried uninstalling and it wouldn't let me do that either (same error). I finally went into Project / Add Reference / COM, selected "Microsoft Excel 16.0 Object Library" and that solved the problem. I'm not sure if the initial NuGet install set that and it somehow get unchecked later, but my project now builds successfully.