Adding Connected WCF Service to .NET 3.1 project results in access denied error

ScottM 331 Reputation points
2021-10-29T16:29:01.877+00:00

I have a .NET core 3.1 project in VS2019. Attempting to add a connected service reference for a legacy WCF service. However, it blows up during scaffolding with access denied error even though I am running VS2019 as administrator.

Importing web service metadata ...
Scaffolding service reference code ...
ErrorAccess to the path 'C:\Users\myuser\AppData\Local\Temp\WCFConnectedService\2021_Oct_29_11_01_02\svcutil_starter\nuget.config' is denied.
Done.
ErrorFailed adding service reference(s). Index (zero based) must be greater than or equal to zero and less than the size of the argument list.

Looking at the nuget.config, you can clearly see that it is a readonly file. I can remove the readonly attribute and try again but it doesn't affect the outcome since this folder is auto generated on each service reference attempt.

Please help.

Microsoft Visual Studio Professional 2019
Version 16.11.5
VisualStudio.16.Release/16.11.5+31729.503
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Professional

Windows 10 19042.1165

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,357 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,223 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Michael Taylor 47,806 Reputation points
    2021-10-29T17:58:18.267+00:00

    It is discussed here.

    1 person found this answer helpful.
    0 comments No comments

  2. ScottM 331 Reputation points
    2021-10-29T18:14:46.143+00:00

    I checked but neither my solution or project level folders have a nuget.config. So no idea how the nuget.config is causing a readonly error.


  3. ScottM 331 Reputation points
    2021-10-29T18:38:29.227+00:00

    Checked and the global nuget.config does not have a readonly attribute.