在Visual Studio 2012中的Razor文件中设置断点

在Visual Studio 2012中的Razor文件中设置断点,razor,visual-studio-2012,Razor,Visual Studio 2012,在Visual Studio 2012中,我尝试在razor(.cshtml)文件中设置断点,但每次尝试时,它都会说断点不能为ser,否则我会收到以下错误消息: 无法设置以下断点: ... 公共语言运行库无法设置断点。我发现在我的web.config中,我有以下行: <compilation debug="true" targetFramework="4.0" assemblyPostProcessorType="Microsoft.VisualStudio.Enterp

在Visual Studio 2012中,我尝试在razor(.cshtml)文件中设置断点,但每次尝试时,它都会说断点不能为ser,否则我会收到以下错误消息:

无法设置以下断点: ...
公共语言运行库无法设置断点。

我发现在我的web.config中,我有以下行:

<compilation 
    debug="true" targetFramework="4.0"
    assemblyPostProcessorType="Microsoft.VisualStudio.Enterprise.Common.AspPerformanceInstrumenter, Microsoft.VisualStudio.Enterprise.AspNetHelper, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

assemblyPostProcessorType属性导致了该问题。我假设它对动态生成的razor程序集做了一些破坏调试的事情

因此,我只是删除了该属性以获得:

<compilation debug="true" targetFramework="4.0" />