Installing NuGet Package: "Access to the path 'c:\Documents and Settings' is denied."

PaulOTron2000

First, I must ask for patience... Although I was a real paid developer 15 years ago, now I own low-tech business and haven't touched it in a long time. Back in the day VB.NET was new and I did maybe two medium-size projects with it. So, I'm behind the times and all my training is ancient, but now I need a little project for my business and I only trust myself to get it done right.

So now I've installed Visual Studio Community 2019, and I'm running Windows 7. (Because it still ain't broke.) and I'd like to use the Google Calendar API in a WinForms app. (But this question could probably apply to many API's.)

I've watched this video (which is from a C# guy but the code differences are trivial.)

https://youtu.be/qNdpWph4Pi8?t=162

And as you'll notice this link goes to 2:42 in the video, which is where it fails. The output from the Package Manager says:

Attempting to gather dependency information for package 'Google.Apis.Calendar.v3.1.49.0.2086' with respect to project 'WindowsApp1', targeting '.NETFramework,Version=v4.7.2'
Access to the path 'c:\Documents and Settings' is denied.
Access to the path 'c:\Documents and Settings' is denied.
Gathering dependency information took 45 ms
Attempting to resolve dependencies for package 'Google.Apis.Calendar.v3.1.49.0.2086' with DependencyBehavior 'Lowest'
Unable to resolve dependency 'Google.Apis'. Source(s) used: 'Package source', 'Microsoft Visual Studio Offline Packages'.
Time Elapsed: 00:00:00.3002072
========== Finished ==========

What I've tried: Lots of browsing, and a few dead ends. I am logged in as Administrator, I have un-hidden that folder, I have allowed full control (which I probably shouldn't) and I am aware that in Windows 7 that folder is just a shortcut, but it seems the package itself is pointing to that folder because I certainly didn't tell it to tinker with it. I'm out of ideas. Any guidance on what to try next? I kinda hope the answer isn't "Get Windows 10".

PaulOTron2000

I was tempted to delete my post because I resolved it... BUT maybe this can help someone. The answer was under Tools > NuGet Package Manager > Package Manager Settings. And from there I don't know what I did, but below are my current settings, which worked.

I honestly still don't know what all these things do and I don't recall what the defaults were, so be careful duplicating this answer... I THINK I changed the default package management format, and also I added the highlighted package source, which wasn't present as Visual Studio was originally installed.

enter image description here

enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

NuGet installing package error

Installing nuget package from GitHub

Error installing nuget package Swashbuckle

Xamarin.Auth NUGet package not installing

Nuget package not installing, failed to add reference

Installing package with Nuget in .NET core on mac

Installing NuGet Package Requesting the Wrong URL

How to stop .Net NuGet Package Manager from installing other packages while installing Npgsql Package

Localization not working in .NET Maui Android project in combination with installing nuget package

Can I work around adding these .dlls when installing NuGet package?

Installing MailChimp.NET package from Visual Studio NuGet manager

Installing GooglePlayServices with NuGet gives me a Install-Package error

How to execute custom script when installing nuget package?

How to change the packages.config location when installing a NuGet package

Nuget manager not installing packages from internet using package manager

Installing SQLite NuGet Package installs the package but the reference is not available. VS2019 Community

The content folder in my nuget package isn't adding the files to the root when installing the package

Installing NuGet package located in local package repository into a new Visual Studio Solution

Installing a package

Nuget.build package needs re-installing if you delete packages

TFS204018 error when installing NuGet Package in VS2015

Installing NuGet package causes server error in application (ASP.NET on .NET Framework)

Installing a .NetStandard 2.0 Nuget package into a VS2015 Net 4.6.1 project

How do I stop ServiceStack 3.9.71 NuGet package installing ServiceStack.Text 4.0.24?

Build error after installing Microsoft.Azure.Mobile.Client NuGet package

Error When installing NuGet package 'Microsoft.AspNet.Http.Extensions 1.0.0-beta3'

"Error: Could not install package" when Installing iCal.NET from "Manage NuGet Packages" Feature in Visual Studio

NuGet failed installing ImageSharp

Nuget error "Object reference not set to an instance of an object" while installing Entityframework 7 from Package Manager Console in VS2015