mej*_*ggs 24 intellisense razor visual-studio-2015
当我在2015年加载我的VS2013项目时,我所有的剃刀视图都充满了红色波浪形的下划线.
@model,@ Scripts @url,@ Html.Partial,lambda表达式
Intellisense现在相当无用,因为它似乎缺少了一半的选项.
我见过的解决方案涉及删除.vs文件夹和devenv.exe/ResetUserData,但这些对我不起作用.
我正在使用与我的同事相同的安装文件重新安装VS 2015社区.他们都没有剃刀问题,他们正在和我一样在同一个项目上工作.
知道如何解决这个问题吗?
编辑...更多信息!我卸载/重新安装了VS 2015社区,打开了我的项目,剃刀工作了!然后我点击了一条通知说要更新NuGet.NuGet更新安装,VS重新启动,剃须刀再次停止工作.所以NuGet的更新是打破剃刀?
每次打开剃刀文件时都会显示"遇到异常.这可能是由扩展引起的.您可以通过检查文件'C:\ Users\Jonathan\AppData\Roaming\Microsoft\VisualStudio\14.0获取更多信息\ ActivityLog.xml'."
在活动日志中,我收到以下错误
"System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Item has already been added. Key in dictionary: 'RazorSupportedRuntimeVersion' Key being added: 'RazorSupportedRuntimeVersion' at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) at System.Collections.Hashtable.Add(Object key, Object value) at System.Collections.Specialized.HybridDictionary.Add(Object key, Object value) at Microsoft.VisualStudio.Utilities.PropertyCollection.AddProperty(Object key, Object property) at Microsoft.VisualStudio.Html.Package.Razor.RazorVersionDetector.Microsoft.Html.Editor.ContainedLanguage.Razor.Def.IRazorVersionDetector.GetVersion(ITextBuffer textBuffer) at Microsoft.Html.Editor.ContainedLanguage.Razor.RazorUtility.TryGetRazorVersion(ITextBuffer textBuffer, Version& razorVersion) at Microsoft.Html.Editor.ContainedLanguage.Razor.RazorErrorTagger..ctor(ITextBuffer textBuffer) --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, Object[] args) at Microsoft.Html.Editor.ContainedLanguage.Common.ContainedCodeErrorTaggerProvider`1.CreateTagger[T](ITextBuffer textBuffer) at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GatherTaggers(ITextBuffer textBuffer)"
Run Code Online (Sandbox Code Playgroud)
我该如何解决?
fab*_*tto 22
您无需使用devenv.exe /ResetUserData
解决方法重置Visual Studio的整个配置
而不是它,尝试在Visual Studio关闭时删除此目录的内容,然后重新打开它:
%LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache
Hum*_*ngs 14
以下是最终为我工作的内容:开始 - >运行 - >(或Windows键+ R)然后键入"devenv.exe/resetuserdata"(当然没有引号)
我没有像其他人经历的那样删除.vs文件.
另请参见:Visual Studio 2015 Broken Razor Intellisense
我升级到mvc5等等到razer 3.它解决了我的问题.
我按照这个说明操作:
http://www.asp.net/mvc/overview/releases/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web- api-2 1
小智 5
有同样的问题.ResetUserData不起作用等.ResetUserData做了什么但重置了一些被抑制的对话框.最终会弹出一个对话框,说明"'CompatiblityCheckerPackage'没有正确加载." 它告诉我转到我的用户文件夹(下面的路径)并查看ActivityLog.xml.原来,WebEssentials 2015没有正确安装并且无法加载.我再次安装了WebEssentials,Intellisense错误消失了.
我的完整路径:
C:\用户\ XXX \应用程序数据\漫游\微软\ VisualStudio的\ 14.0\ActivityLog.xml
希望这可以帮助.
这可以解决类似的问题(我从某个地方得到它,不幸的是我不记得了,在Github上)
> cd "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\Common7\IDE"
> devenv /updateconfiguration
> devenv /clearcache
我希望以上内容对某人有所帮助. 归档时间: |
|
查看次数: |
16499 次 |
最近记录: |