One of the nice features of VS2012 was that when I'm editing an HTML (or .cshtml) file, it provided great intellisense.
When I start to type:
<a href="
The editor would open a prompt with "Pick URL..." and a list of possible options based on the current directory of the file.
^ Visual Studio 2012
Furthermore, in VS2012 the editor would detect any referenced CSS file(s), like this:
<link rel="stylesheet" type="text/css" href="bootstrap.css" />
And would provide autocompletion of all CSS classes inside that file.
So if I type:
<div class="
I would be prompted with all Bootstrap3 classes automatically. Like this:
^ Visual Studio 2012
However in VS2013 both of these features seem to be missing.
Now when I look for CSS classes I only get classes that I've already used inside the file:
^ Visual Studio 2013
According to the articles HTML Editing Features in Visual Studio 2013 Preview and HTML Editing Features in Visual Studio 2013 RC by Microsoft, these issues seem to be touched on but are more aimed at the Release Candidate or beta versions of VS2013. I'm using VS2013 Ultimate 12.0.21005.1 REL with all the latest update that I'm aware of.
Why is VS2013 not detecting CSS files for class autocompletion and not prompting me for URLs when writing href=
?
After intellisense worked fine for a few weeks, I just ran into the same problem as the OP. Uninstalling and re-installing packages using NuGet did not resolve it.
Deleting the bin and obj directories from the project and the .suo file from the solution directory resolve it.
This was a change between Visual Studio 2012 and Visual Studio 2013.
Previously, simply opening a file in Visual Studio 2012 (not a solution, just an HTML file) and using
<link rel="stylesheet" href="bootstrap.css" />
in the HTML file meant that Visual Studio would read inside the CSS file and give CSS class intellisense. Microsoft abandoned this approach, because:
it failed to work in cases where files were included dynamically, or where ASP.NET Bundling and Minification was utilized
[Source]
In Visual Studio 2013, CSS files that are included in your project/solution will now automatically be parsed and all HTML documents will gain CSS class intellisense.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With