简体   繁体   English

Visual Studio 2015 CSS Intellisense破碎

[英]Visual Studio 2015 CSS Intellisense Broken

Editing cshtml files, I'm used to getting Bootstrap intellisense, regardless of what classes I've already used in said file, like so: 编辑cshtml文件,我习惯于获取Bootstrap intellisense,无论我在所述文件中使用过什么类,如下所示:

当事情有效

Originally, I thought it was just Bootstrap intellisense, but it appears that this is affecting all CSS for my new project. 最初,我认为它只是Bootstrap intellisense,但它似乎影响了我的新项目的所有CSS。 I can link to the CSS files, directly reference the layout file, it doesn't matter. 我可以链接到CSS文件,直接引用布局文件,没关系。 The Bootstrap and other CSS classes do not show, unless I've already used them in the same file: Bootstrap和其他CSS类没有显示,除非我已经在同一个文件中使用过它们:

当它不起作用

I've tried to minimize the differences between the two projects, but to no avail. 我试图尽量减少两个项目之间的差异,但无济于事。 They are on different machines, in different solutions, but everything else is virtually exactly the same. 它们在不同的机器上,在不同的解决方案中,但其他一切几乎完全相同。 Here's what I've checked/tried so far. 这是我到目前为止检查/尝试的内容。

  • Delete the project, re-add it. 删除项目,重新添加。
  • Remove the Bootstrap Nuget package re-add it 删除Bootstrap Nuget包重新添加它
  • Remove the Bootstrap Snippet Pack, Glyphfriend, Web Essentials 2015.2 extensions, re-add them. 删除Bootstrap Snippet Pack,Glyphfriend,Web Essentials 2015.2扩展,重新添加它们。
  • Delete the bin and obj folders, build, clean, rebuild, close/reopen VS, restart Windows. 删除bin和obj文件夹,构建,清理,重建,关闭/重新打开VS,重新启动Windows。
  • Deleted this folder to allow for recreation: C:\\Users\\MyUserName\\AppData\\Local\\Microsoft\\VisualStudio\\14.0\\ComponentModelCache 删除此文件夹以允许重新创建:C:\\ Users \\ MyUserName \\ AppData \\ Local \\ Microsoft \\ VisualStudio \\ 14.0 \\ ComponentModelCache
  • Both machines are running VS 2015 Update 2. 两台机器都运行VS 2015 Update 2。
  • Both projects are MVC 5. 这两个项目都是MVC 5。
  • Installed all updates possible in Nuget Package Manager 在Nuget Package Manager中安装了所有可能的更新

Known differences - The machine it works on is running Windows 7, the machine it doesn't is running Windows 10. 已知的差异 - 它运行的机器运行Windows 7,它没有运行Windows 10的机器。

I've run into this problem again and found a solution! 我再次遇到这个问题并找到了解决方案! I'm not sure if it's the same as the original problem I had, but here's the fix anyway. 我不确定它是否与我原来的问题相同,但无论如何这里都是修复。

If the solution has a SQL project (.dbproj), unload it (right click > unload project). 如果解决方案具有SQL项目(.dbproj),请将其卸载(右键单击>卸载项目)。 There's some weird bug in VS2015 with Bootstrap and SQL database projects that make intellisense for Bootstrap stop working. VS2015中有一些奇怪的错误,它带有Bootstrap和SQL数据库项目,使得Bootstrap的intellisense停止工作。

In order to get "Class" IntelliSense in VS 2015, try this method. 为了在VS 2015中获得“Class”智能感知,请尝试此方法。 It works for me as follows: 它对我有用,如下:

Ex: Right click on any .aspx file in "Solution Explorer" of VS then select "Open With" option then from the list select "HTML Editor" option. 例如:右键单击VS的“解决方案资源管理器”中的任何.aspx文件,然后选择“打开方式”选项,然后从列表中选择“HTML编辑器”选项。 Now try to check. 现在尝试检查。

Thanks 谢谢
Ali 阿里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM