簡體   English   中英

Dotnet 新控制台在運行時返回錯誤

[英]Dotnet new console returning error on run

我曾多次嘗試在任何終端中運行“dotnet new console”,但每次都返回錯誤:

Unhandled exception: System.UnauthorizedAccessException: Access to the path 'C:\Users\Trist\.templateengine\dotnetcli\v7.0.101' is denied.
   at System.IO.FileSystem.CreateDirectory(String fullPath, Byte[] securityDescriptor)
   at System.IO.Directory.CreateDirectory(String path)
   at Microsoft.TemplateEngine.Utils.PhysicalFileSystem.CreateDirectory(String path)
   at Microsoft.TemplateEngine.Cli.Commands.BaseCommand.CreateEnvironmentSettings(GlobalArgs args, ParseResult parseResult)
   at Microsoft.TemplateEngine.Cli.Commands.BaseCommand`1.InvokeAsync(InvocationContext context)
   at Microsoft.TemplateEngine.Cli.Commands.BaseCommand`1.Invoke(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.DotNet.Cli.Parser.<>c__DisplayClass17_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__17_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass15_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass7_0.<<UseExceptionHandler>b__0>d.MoveNext()

我已經允許文件設置中每個可用用戶的權限,重新安裝並修復了 dotnet。 我已經花了幾個小時了,似乎找不到其他人遇到相同或類似的問題,所以在克服問題方面幾乎沒有取得任何進展。非常感謝任何和所有的幫助

我解決了。 其中一個文件夾中的安全設置在更改后沒有保存,在重新啟動計算機並再次仔細掃描所有內容后,我已經解決了這個問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM