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

我遇到了这个问题,我为 .Net6 创建的一些项目抛出了附图中显示的错误

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

我使用了不同的 IDE VS 2022、ReSharper、VS Code,但错误仍然存​​在。

这是在我安装 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)

最佳答案

我遇到了同样的问题,后来发现是 Windows Security (Defender) 阻止了可执行文件。

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

https://stackoverflow.com/questions/71884268/

相关文章:

html - 一个 SVG 的多个路径的多个复选框

javascript - 检查两个数组是否有一个具有相同属性的对象

go - 用类型参数替换接口(interface)参数有什么好处?

r - 将嵌套列表中的名称分配给它的子组件

javascript - Nuxt中如何使用动态图片?

javascript - 解决对多个参数值的 promise

haskell - 为什么类型为 [tail, init, reverse], [[a] -> [a

reactjs - antd DatePicker 或 RangePicker 如何让日历图标左对齐

c++ - 检查是否存在嵌套类型别名并有条件地设置类型别名

python - 正确完成所有操作后出现 Ngrok 错误 6022