更具体地说,我想寻求一个C#API项目的帮助,这是一个例外,现在已经有很长时间了。目前,这些项目运行于.NET Core 3.1,并且使用Hangfire。
基本上,问题在于,当我们使用Visual Studio 2019时,每当我们有任何处理例外时,应用程序都会保持运行良好,但是一旦我们更新到Visual Studio 2022,开发环境中的任何投掷例外都会使应用程序停止,通常两个例外。让我们假设nullReferenceException发生了,在应用程序将继续运行之后,但是我们会得到一个系统。AccessVioLationException:
这就是问题,AccessVioLationException尽管这是例外(NullreferenceException the Devanception)例如)是处理例外。
启用本机代码调试无济于事,因为它只会提到抛出的例外将在kernelbase.dll。
我阅读了在选项中启用Microsoft符号服务器的某个地方 - > debugging-'符号可能会在此例外中提供更多详细信息,但是启用它可以使应用程序不启动或使其启动太慢。
我们的其他一些项目不会发生这种情况。不确定它是否与此有关,但是其他项目不使用hangfire并在.NET Core 3.1中运行。奇怪的是,其他在同一OS上运行同一项目的计算机在VS2022上没有此类问题。
到目前为止,我们已经试图重新安装.NET Core SDK,重新安装VS2022,该SDK安装了工作计算机具有的SDK,甚至将其降级到VS2019(曾经工作的地方)。他们都没有工作。有人经历过还是有类似的东西?
I would like to ask for help with a C# API Project, to be more specific, an exception that have been giving issues for some pretty long time now. Currently the projects runs on .NET Core 3.1 and it uses Hangfire.
Basically, the problem is that back when we used Visual Studio 2019, whenever we had any handled exception the application would keep running just fine, however once we updated to Visual Studio 2022, any throw exception in development environment will make the application stop giving us usually two exceptions. Lets suppose a NullReferenceException has happened, right after it the application would keep running, however we get a System.AccessViolationException:

That's the issue, the AccessViolationException will make the application stop despite the exception that caused it (NullReferenceException for example) be a handled exception.
Enabling native code debugging doesn't help much since it will just mention that the exception thrown will be at the KernelBase.dll.
I read somewhere that enabling Microsoft Symbols Servers in Options->Debugging->Symbols may give more details into this exception, but enabling it either makes the application not start or makes it starts way too slowly.
This doesn't happen with some of our other projects. Not sure if it has anything to do with it, but that other project doesn't use Hangfire and runs in .NET Core 3.1. Weirdly, other computers that runs the same project, on the same OS, on VS2022 doesn't have such issue.
So far we've tried to reinstall the .NET Core Sdks, reinstall VS2022, installing the same Sdk that the working computers have and even downgrading to VS2019 (where it used to work). None of them have worked. Did anyone went through this or had something similar?
发布评论