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

问题描述:

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

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

我发现,在我的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属性是造成问题。我假设它对动态生成的剃须刀组件进行了一些处理,以打破调试。

所以我只是删除了属性得到:

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