在安装然后修复我的VS2015实例后,我仍然无法让智能感知(服务器端)在我的MVC视图中工作.我第一次在会话中打开一个.cshtml文件时会收到消息提示,然后发送到Activitylog文件.在ActivityLog.xml(简短版本)中检索到错误消息:
System.ArgumentException:已添加项目.词典中的关键词:'RazorSupportedRuntimeVersion'
这是完整版:
System.Reflection.TargetInvocationException:调用目标抛出了异常.---> System.ArgumentException:已添加项目.词典中的关键词:'RazorSupportedRuntimeVersion'重点正在补充说:"RazorSupportedRuntimeVersion"在System.Collections.Hashtable.Insert(对象键,对象n值,布尔加)在System.Collections.Hashtable.Add(对象键,对象值)System.Collections.Specialized.HybridDictionary.Add在Microsoft.VisualStudio.Utilities.PropertyCollection.AddProperty(对象键,对象属性)在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内部异常堆栈跟踪---在System.System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr)中的System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr,Binder binder,Object []参数,CultureInfo文化)中的RuntimeMethodHandle.InvokeMethod(Object target,Object []参数,Signature sig,Boolean构造函数) System.Activator.CreateInstance(Type type,BindingFlags bindingAttr,Binder binder,Object [] args,CultureInfo culture,Object [] activationAttributes)at,Binder binder,Object [] args,CultureInfo culture,Object [] activationAttributes,StackCrawlMark&stackMark) Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator'中的Microsoft.Html.Editor.ContainedLanguage.Common.ContainedCodeErrorTaggerProvider'1.CreateTagger [T](ITextBuffer textBuffer)中的System.Activator.CreateInstance(Type type,Object [] args)1.GatherTaggers(ITextBuffer textBuffer)
如果有任何帮助,我会进行一些字体着色自定义,并安装Web Essentials,Bundler和Minifier以及Web编译器扩展.
更新:当我打开现有的Web应用程序或从头开始创建一个全新的Web应用程序时,它就会发生.还有一个VS2013的实例在同一台机器上安装并运行.
正如你从上面的图片中看到的那样,我根本没有智能感知,也没有任何代码着色.
有关如何解决它的任何线索?提前致谢.
我在VS2015 RC中的Razor视图没有显示C#代码的正确着色.我的项目在VS2013中运行良好,但它不是在2015年,而且它没有给我任何关于C#代码的Intellisense.解决方案构建,网站运行正常.
我尝试了以下无济于事
.suo
文件我怎样才能解决这个问题?
例:
我刚刚切换到VS 2015.我有一个较旧的MVC 5应用程序,运行4.52.在VS 2013中,它非常好.
在VS 2015中,我的红色波浪形在我的下面,@Html.TextBoxFor()
有一个错误表明:
"Expression <>"类型在未引用的程序集中定义.您必须添加对程序集'System.Core,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'的引用.
该项目构建和运行正常 - 但我担心VS 2013中从未发生的IntelliSense错误.好的,所以我尝试按照上面的错误中的建议添加对System.Core的引用,然后我收到此错误:
无法添加对"System.Core"的引用.构建系统已自动引用此组件.
再次,这在VS 2013中很好.
我在Windows 8上全新安装了VS2015,并且intellisense在任何环境中根本不起作用(没有!).
我也有VS2013(与Resharper 8)在同一台机器上工作正常.
在重新安装之前有什么想法吗?