简体   繁体   English

源不可用错误(源实际可用)

[英]Source Not Available error(Source is available actually)

I have created WPF application solution, added a third-party(cloned git repo locally on my machine) library(Class Library output type) project to the solution, added the library project to my solution:我已经创建了 WPF 应用程序解决方案,在解决方案中添加了第三方(在我的机器上本地克隆 git repo)库(类库输出类型)项目,将库项目添加到我的解决方案中: 在此处输入图片说明

And then referenced it in WPF Project settings:然后在 WPF 项目设置中引用它: 在此处输入图片说明

When a library throws an exception, I get this in Visual Studio:当库抛出异常时,我在 Visual Studio 中得到了这个: 在此处输入图片说明

I can edit the library project, edit the WPF project, compile everything and it will work.我可以编辑库项目,编辑 WPF 项目,编译一切,它会工作。 But for whatever reason when an exception is thrown I can't debug the library.但是无论出于何种原因抛出异常时,我都无法调试库。 How do I fix this?我该如何解决?

I fixed Source Not Available error fix by unchecking Use Managed Compatibility Mode Checkbox(checked checkbox causes error to appear) in Tools-Options , Debugging-General :我通过在Tools-OptionsDebugging-General取消选中 Use Managed Compatibility Mode Checkbox(选中的复选框导致出现错误)来修复 Source Not Available 错误修复:

在此处输入图片说明

If someone reads this and knows why Use Managed Compatibility Mode was checked and why I couldn't debug my library because of it, please tell us.如果有人阅读了这篇文章并知道为什么选中了“使用托管兼容模式”以及为什么我因此无法调试我的库,请告诉我们。 It took me few hours of googling, asking people around, and trial and error, until I found out that it was my options(after I decided to reset them to see if it was them).我花了几个小时的谷歌搜索,询问周围的人,反复试验,直到我发现这是我的选择(在我决定重置它们以查看是否是它们之后)。 I didn't change this checkbox by myself, I would have remembered it.我没有自己更改此复选框,我会记住它。 It was like that from the start.从一开始就是这样。 I only export my options from older versions of Visual Studio(Visual Studio 2015 > 2017 > 2019) to preserve code style and other options I like.我只从旧版本的 Visual Studio(Visual Studio 2015 > 2017 > 2019)导出我的选项,以保留我喜欢的代码样式和其他选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM