无法启动程序,访问被拒绝C#Net6.0

发布于 2025-01-21 13:01:17 字数 1388 浏览 1 评论 0原文

我有一个问题,我为.net6创建的某些项目抛出了附加图像中显示的错误

“在此处输入图像描述”

在这种情况下,项目运行良好,突然间,错误开始弹出。我试图自己和互联网上找到解决方案。

我使用了不同的IDE vs 2022,Resmanper,VS代码,并且错误持续存在。

当我安装2022和.NET6 SDK时,这开始了。正式使用VS 2019。

有帮助吗?

因此,到目前为止,我所做的就是进行系统重置。一切都很好,直到几个小时。我试图将CMD用作管理员。我想指出,解决方案上有几个项目,但是一个人不断提出此错误。

System.ComponentModel.Win32Exception (5): An error occurred trying to start process 'C:\Users\xxxxxxxxxxxxx\source\repos\ProjectTemplate2022v3\src\Skoruba.Duende.IdentityServer.Admin\bin\Debug\net6.0\Skoruba.Duende.IdentityServer.Admin.exe' with working directory 'C:\Users\xxxxxxxxxxxxx\source\repos\ProjectTemplate2022v3\src\Skoruba.Duende.IdentityServer.Admin'. Access is denied.
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at Microsoft.DotNet.Cli.Utils.Command.Execute(Action`1 processStarted)
   at Microsoft.DotNet.Cli.Utils.Command.Execute()
   at Microsoft.DotNet.Tools.Run.RunCommand.Execute()
   at Microsoft.DotNet.Tools.Run.RunCommand.Run(String[] args)
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)
   at Microsoft.DotNet.Cli.Program.Main(String[] args)

I have this issue where some of the projects I created for.Net6 throws the error shown in the image attached

enter image description here

In this instance the project was running fine, suddenly, the error started to pop up. I have tried to find a solution by myself and on the internet.

I have used different IDEs VS 2022, ReSharper, VS Code, and the error persists.

This started when I installed VS 2022 and .Net6 SDK. Was formally using VS 2019.

Any help?

So, what I have done so far was to do a system reset. Everything was working well until a couple of hours now. I tried to use CMD as admin to run. I would like to point out that I have a couple of projects on the solution, but one keeps throwing this error.

System.ComponentModel.Win32Exception (5): An error occurred trying to start process 'C:\Users\xxxxxxxxxxxxx\source\repos\ProjectTemplate2022v3\src\Skoruba.Duende.IdentityServer.Admin\bin\Debug\net6.0\Skoruba.Duende.IdentityServer.Admin.exe' with working directory 'C:\Users\xxxxxxxxxxxxx\source\repos\ProjectTemplate2022v3\src\Skoruba.Duende.IdentityServer.Admin'. Access is denied.
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at Microsoft.DotNet.Cli.Utils.Command.Execute(Action`1 processStarted)
   at Microsoft.DotNet.Cli.Utils.Command.Execute()
   at Microsoft.DotNet.Tools.Run.RunCommand.Execute()
   at Microsoft.DotNet.Tools.Run.RunCommand.Run(String[] args)
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)
   at Microsoft.DotNet.Cli.Program.Main(String[] args)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梅窗月明清似水 2025-01-28 13:01:17

我遇到了同样的问题,后来弄清楚了Windows Security(Defender)正在阻止可执行文件。

转到Windows安全 - >病毒和威胁保护设置 - >排除并将您的EXE添加到排除列表中。

I had the same problem and later figured out that Windows Security (Defender) was blocking the executable.

Go to Windows Security -> Virus and Threat protection settings -> Exclusions and add your exe to the exclusion list.

风月客 2025-01-28 13:01:17

我只是遇到了同样的问题。快速修复我要运行它是使用“ iisexpress”运行。

I just had the same problem. Quick fix for me to get it to run is to run using "IISExpress".. See below picture.

enter image description here

半衬遮猫 2025-01-28 13:01:17

改善霍普尔的回答。对于Windows 11:

转到Windows安全 - >病毒和威胁保护设置 - >管理设置 - >添加或删除排除。

To improve on Shameel's answer. For Windows 11:

Go to Windows Security -> Virus and Threat protection settings -> Manage settings -> Add or remove exclusions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文