无法启动程序,访问被拒绝C#Net6.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
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我遇到了同样的问题,后来弄清楚了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.
我只是遇到了同样的问题。快速修复我要运行它是使用“ iisexpress”运行。
I just had the same problem. Quick fix for me to get it to run is to run using "IISExpress".. See below picture.
改善霍普尔的回答。对于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.