Visual Studio MVC剃刀查看intelisens和断点不起作用。 [英] Visual studio MVC razor view intelisens and breakpoint not working.
问题描述
我正在使用visual studio 2012(Premium)。我有一个使用MVC的项目。我无法向视图添加任何断点,因此无法在视图侧调试变量。
此外,Intelisens也没有在视图中工作。
我尝试过:
我尝试重置用户设置devenv.exe / resetusersetting。
尝试使用以下命令清除缓存:
I am using visual studio 2012 (Premium). I have a project that is using MVC. I am not able to add any breakpoint to the view(s) and thus unable to debug the variables at view side.
Moreover, Intelisens is also not working at views.
What I have tried:
I tried resetting the user setting devenv.exe/resetusersetting.
Tried clear the cache using below command:
C:\Users\pgoel\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
我也尝试了很多其他的东西,我在寻找解决方案时遇到了但没有任何作用。请帮我解决。
I also tried many other things I came cross while looking for the solution but nothing works. Please help me out to get it fixed.
推荐答案
在花了很多时间寻找解决方案后,我遇到了MVC项目的版本,我是MVC的版本使用应该安装在环境中。虽然如果我已经添加了dll但没有安装在环境中,该项目将起作用,但intellisense将无法工作。
After spending a lot of time looking for solution, I come across that for MVC projects, the version of MVC I am using should be installed in the environment. Although if I have added the dll but not installed in environment, the project will work but intellisense won't work.
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
</dependentAssembly>
这是修复。转到web.config。查看您正在使用的MVC的版本并运行以下Nuget命令进行安装。
Here is the fix. Go to web.config. See the version of MVC you are using and run the following Nuget command to install it.
PM > Install-Package Microsoft.AspNet.Mvc -Version 5.2.3
版本应与web.config或MVC dll中提到的相同。
有关详细信息,请参阅链接 [ ^ ]
这篇关于Visual Studio MVC剃刀查看intelisens和断点不起作用。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!