microsoft / microsoft/win-dev-skills

[Bug]: Permission denied and could not request permission from user error

Open
#94 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
442
Forks
33
Avg merge
2h 59m
Merged PRs (30d)
11

Description

Describe the bug

When agent tried to run this command it gets:

✗ Create WinUI MVVM project and list files (shell)
│ dotnet new winui-mvvm -n SimpleCalculator && cd .\\SimpleCalculator && Get-ChildItem -Recurse -File | Select-Object -First 200 | ForEach-Object {
│ $_.FullName }
└ Permission denied and could not request permission from user

but when i run it successfully runs:


PowerShell 7.6.1
Loading personal and system profiles took 1256ms.
PS C:\Users\nakul> cd win
PS C:\Users\nakul\win> dotnet new winui-mvvm -n CalculatorApp
The template "WinUI MVVM App" was created successfully.

Processing post-creation actions...
Adding a package reference Microsoft.WindowsAppSDK to project file C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj:
info : X.509 certificate chain validation will use the default trust store selected by .NET for code signing.
info : X.509 certificate chain validation will use the default trust store selected by .NET for timestamping.
info : Adding PackageReference for package 'Microsoft.WindowsAppSDK' into project 'C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj'.
info :   GET https://api.nuget.org/v3/registration5-gz-semver2/microsoft.windowsappsdk/index.json
info :   OK https://api.nuget.org/v3/registration5-gz-semver2/microsoft.windowsappsdk/index.json 397ms
info : Restoring packages for C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj...
info :   GET https://api.nuget.org/v3-flatcontainer/communitytoolkit.mvvm/index.json
info :   GET https://api.nuget.org/v3-flatcontainer/microsoft.windows.sdk.buildtools.winapp/index.json
info :   OK https://api.nuget.org/v3-flatcontainer/communitytoolkit.mvvm/index.json 340ms
info :   OK https://api.nuget.org/v3-flatcontainer/microsoft.windows.sdk.buildtools.winapp/index.json 342ms
info :   GET https://api.nuget.org/v3-flatcontainer/communitytoolkit.mvvm/8.4.2/communitytoolkit.mvvm.8.4.2.nupkg
info :   GET https://api.nuget.org/v3-flatcontainer/microsoft.windows.sdk.buildtools.winapp/0.3.1/microsoft.windows.sdk.buildtools.winapp.0.3.1.nupkg
info :   OK https://api.nuget.org/v3-flatcontainer/microsoft.windows.sdk.buildtools.winapp/0.3.1/microsoft.windows.sdk.buildtools.winapp.0.3.1.nupkg 25ms
info :   OK https://api.nuget.org/v3-flatcontainer/communitytoolkit.mvvm/8.4.2/communitytoolkit.mvvm.8.4.2.nupkg 26ms
info :   GET https://api.nuget.org/v3-flatcontainer/microsoft.windowsappsdk.foundation/index.json
info :   OK https://api.nuget.org/v3-flatcontainer/microsoft.windowsappsdk.foundation/index.json 283ms
info :   GET https://api.nuget.org/v3-flatcontainer/microsoft.windows.sdk.net.ref/index.json
info :   OK https://api.nuget.org/v3-flatcontainer/microsoft.windows.sdk.net.ref/index.json 298ms
info :   GET https://api.nuget.org/v3-flatcontainer/microsoft.windows.sdk.net.ref/10.0.26100.57/microsoft.windows.sdk.net.ref.10.0.26100.57.nupkg
info :   OK https://api.nuget.org/v3-flatcontainer/microsoft.windows.sdk.net.ref/10.0.26100.57/microsoft.windows.sdk.net.ref.10.0.26100.57.nupkg 28ms
info : Installed CommunityToolkit.Mvvm 8.4.2 from https://api.nuget.org/v3/index.json to C:\Users\nakul\.nuget\packages\communitytoolkit.mvvm\8.4.2 with content hash WadCzGEc2U+3e20avRLng4qNtt4zoOGWrdUISqJWrHe3/FSnrYjuM5Sb4yQb09LhkBXrrI4Zt3dLKgRMbItsrg==.
info : Installed Microsoft.Windows.SDK.BuildTools.WinApp 0.3.1 from https://api.nuget.org/v3/index.json to C:\Users\nakul\.nuget\packages\microsoft.windows.sdk.buildtools.winapp\0.3.1 with content hash QOJTNCLXq9YC04atytO1EQOkvBXqghbbAh4Gxs9BR4g7BZ8vGEqgjbclq6CTe30RPFsa2LeyNtWh+GmG5jWdsw==.
info : Installed Microsoft.Windows.SDK.NET.Ref 10.0.26100.57 from https://api.nuget.org/v3/index.json to C:\Users\nakul\.nuget\packages\microsoft.windows.sdk.net.ref\10.0.26100.57 with content hash fblsw58XVRk9MATXP6E+l0bXEPoUOG8F0kvdhYD+QxnLM1ztkDiFBwB8Ci0qLAUnxurKQS1udjZ6U4/PyZP+Tw==.
info :   GET https://api.nuget.org/v3/vulnerabilities/index.json
info :   OK https://api.nuget.org/v3/vulnerabilities/index.json 260ms
info :   GET https://api.nuget.org/v3-vulnerabilities/2026.05.18.23.32.55/vulnerability.base.json
info :   GET https://api.nuget.org/v3-vulnerabilities/2026.05.18.23.32.55/2026.05.21.11.33.10/vulnerability.update.json
info :   OK https://api.nuget.org/v3-vulnerabilities/2026.05.18.23.32.55/2026.05.21.11.33.10/vulnerability.update.json 280ms
info :   OK https://api.nuget.org/v3-vulnerabilities/2026.05.18.23.32.55/vulnerability.base.json 331ms
info : Package 'Microsoft.WindowsAppSDK' is compatible with all the specified frameworks in project 'C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj'.
info : PackageReference for package 'Microsoft.WindowsAppSDK' version '2.0.1' updated in file 'C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj'.
info : Generating MSBuild file C:\Users\nakul\win\CalculatorApp\obj\CalculatorApp.csproj.nuget.g.props.
info : Generating MSBuild file C:\Users\nakul\win\CalculatorApp\obj\CalculatorApp.csproj.nuget.g.targets.
info : Writing assets file to disk. Path: C:\Users\nakul\win\CalculatorApp\obj\project.assets.json
log  : Restored C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj (in 9.42 sec).
Successfully added a reference to the project file.

Adding a package reference Microsoft.Windows.SDK.BuildTools to project file C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj:
info : X.509 certificate chain validation will use the default trust store selected by .NET for code signing.
info : X.509 certificate chain validation will use the default trust store selected by .NET for timestamping.
info : Adding PackageReference for package 'Microsoft.Windows.SDK.BuildTools' into project 'C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj'.
info :   GET https://api.nuget.org/v3/registration5-gz-semver2/microsoft.windows.sdk.buildtools/index.json
info :   OK https://api.nuget.org/v3/registration5-gz-semver2/microsoft.windows.sdk.buildtools/index.json 363ms
info : Restoring packages for C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj...
info :   CACHE https://api.nuget.org/v3-flatcontainer/microsoft.windowsappsdk.foundation/index.json
info :   CACHE https://api.nuget.org/v3/vulnerabilities/index.json
info :   CACHE https://api.nuget.org/v3-vulnerabilities/2026.05.18.23.32.55/vulnerability.base.json
info :   CACHE https://api.nuget.org/v3-vulnerabilities/2026.05.18.23.32.55/2026.05.21.11.33.10/vulnerability.update.json
info : Package 'Microsoft.Windows.SDK.BuildTools' is compatible with all the specified frameworks in project 'C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj'.
info : PackageReference for package 'Microsoft.Windows.SDK.BuildTools' version '10.0.28000.1839' updated in file 'C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj'.
info : Generating MSBuild file C:\Users\nakul\win\CalculatorApp\obj\CalculatorApp.csproj.nuget.g.props.
info : Generating MSBuild file C:\Users\nakul\win\CalculatorApp\obj\CalculatorApp.csproj.nuget.g.targets.
info : Writing assets file to disk. Path: C:\Users\nakul\win\CalculatorApp\obj\project.assets.json
log  : Restored C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj (in 185 ms).
Successfully added a reference to the project file.

Adding a package reference Microsoft.Windows.SDK.BuildTools.WinApp to project file C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj:
info : X.509 certificate chain validation will use the default trust store selected by .NET for code signing.
info : X.509 certificate chain validation will use the default trust store selected by .NET for timestamping.
info : Adding PackageReference for package 'Microsoft.Windows.SDK.BuildTools.WinApp' into project 'C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj'.
info :   GET https://api.nuget.org/v3/registration5-gz-semver2/microsoft.windows.sdk.buildtools.winapp/index.json
info :   OK https://api.nuget.org/v3/registration5-gz-semver2/microsoft.windows.sdk.buildtools.winapp/index.json 403ms
info : Restoring packages for C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj...
info :   CACHE https://api.nuget.org/v3-flatcontainer/microsoft.windowsappsdk.foundation/index.json
info :   CACHE https://api.nuget.org/v3/vulnerabilities/index.json
info :   CACHE https://api.nuget.org/v3-vulnerabilities/2026.05.18.23.32.55/vulnerability.base.json
info :   CACHE https://api.nuget.org/v3-vulnerabilities/2026.05.18.23.32.55/2026.05.21.11.33.10/vulnerability.update.json
info : Package 'Microsoft.Windows.SDK.BuildTools.WinApp' is compatible with all the specified frameworks in project 'C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj'.
info : PackageReference for package 'Microsoft.Windows.SDK.BuildTools.WinApp' version '0.3.1' updated in file 'C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj'.
info : Assets file has not changed. Skipping assets file writing. Path: C:\Users\nakul\win\CalculatorApp\obj\project.assets.json
log  : Restored C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj (in 191 ms).
Successfully added a reference to the project file.

Adding a package reference CommunityToolkit.Mvvm to project file C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj:
info : X.509 certificate chain validation will use the default trust store selected by .NET for code signing.
info : X.509 certificate chain validation will use the default trust store selected by .NET for timestamping.
info : Adding PackageReference for package 'CommunityToolkit.Mvvm' into project 'C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj'.
info :   GET https://api.nuget.org/v3/registration5-gz-semver2/communitytoolkit.mvvm/index.json
info :   OK https://api.nuget.org/v3/registration5-gz-semver2/communitytoolkit.mvvm/index.json 381ms
info : Restoring packages for C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj...
info :   CACHE https://api.nuget.org/v3-flatcontainer/microsoft.windowsappsdk.foundation/index.json
info :   CACHE https://api.nuget.org/v3/vulnerabilities/index.json
info :   CACHE https://api.nuget.org/v3-vulnerabilities/2026.05.18.23.32.55/vulnerability.base.json
info :   CACHE https://api.nuget.org/v3-vulnerabilities/2026.05.18.23.32.55/2026.05.21.11.33.10/vulnerability.update.json
info : Package 'CommunityToolkit.Mvvm' is compatible with all the specified frameworks in project 'C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj'.
info : PackageReference for package 'CommunityToolkit.Mvvm' version '8.4.2' updated in file 'C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj'.
info : Writing assets file to disk. Path: C:\Users\nakul\win\CalculatorApp\obj\project.assets.json
log  : Restored C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj (in 176 ms).
Successfully added a reference to the project file.

Restoring C:\Users\nakul\win\CalculatorApp\CalculatorApp.csproj:
Restore succeeded.


PS C:\Users\nakul\win>

Affected skill / tool

Not sure

To Reproduce

run copilot --agent winui:winui-dev -p "build calculator app which ony has addition operation"

Expected behavior

should get permission error:

✗ Create WinUI MVVM project and list files (shell)
│ dotnet new winui-mvvm -n SimpleCalculator && cd .\\SimpleCalculator && Get-ChildItem -Recurse -File | Select-Object -First 200 | ForEach-Object {
│ $_.FullName }
└ Permission denied and could not request permission from user
Session report (strongly recommended)

Build / runtime output

Copilot CLI version

No response

Plugin version

No response

OS version

No response

.NET SDK version

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the command from the issue with copilot --agent winui:winui-dev and compare the agent's shell invocation with the successful PowerShell run. Investigate the permission failure around the dotnet new winui-mvvm command; done when the agent can create and list the project files without the permission error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.