c# - 调试到 .net 源对我不起作用

标签 c# asp.net-mvc debugging

我正在使用 MVC 4(测试版),在尝试测试我编写的 auth 属性时遇到了一些问题。

为了进一步研究这个问题,我尝试使用 debug into .net framework sources 调试选项,以查看到底出了什么问题。我已按照此处的设置说明进行操作:http://weblogs.asp.net/gunnarpeipman/archive/2010/07/04/stepping-into-asp-net-mvc-source-code-with-visual-studio-debugger.aspx

完成所有这些之后,当我调试我的测试以查看发生了什么时,当我进入调用 .net fw 的代码行时,测试刚刚终止并给我异常我'我正在尝试调试。为了完整起见,这是我的代码:

var controller = new MyController();
controller.SetFakeAuthenticatedControllerContext("foo"); // Set up a fake http context for the user

var actionDescriptor = new Mock<ActionDescriptor>();
actionDescriptor.SetupGet(x => x.ActionName).Returns("AddedForTest");

var context = new AuthorizationContext(controller.ControllerContext, actionDescriptor.Object);

var auth = new SamCommandAuthenticationAttribute();
auth.OnAuthorization(context); // On this line the test will just terminate

Assert.Pass(); // This line would never be called.

有谁知道为什么我无法调试 .net 源代码?

最佳答案

Microsoft 符号服务器为 .net 框架程序集的子集提供符号。

我不认为 Mvc4 beta 是其中之一......

----已添加---

正如 Bond 在评论中指出的那样,如果您想进入 MVC4 Beta 源,您必须在您的解决方案中包含 mvc 项目并从那里引用它,方法是首先删除对您已安装的 GAC 版本的引用

关于c# - 调试到 .net 源对我不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10207798/

相关文章:

asp.net-mvc - 为什么这个 ViewResult 失败了 MSpecMVC 的 ShouldBeAView 断言?

.net - 启动部署的我的应用程序会出现 “has stopped working”错误。我该如何调试?

c# - 构造函数重载异常

c# - 获取附件 ContentID

c# - 如何获取具有给定属性的属性列表?

asp.net - Azure DocumentDB 和 Azure Blob 存储

html - Jquery 自动完成 css 错误

c# - 传递凭据适用于 WebRequest,但不适用于 HttpClient

java - 如何在 Java jdb 中跳过断点一定次数?

python - pycharm 调试器未连接 : KeyboardInterrupt