Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2012 saying 'Unable to edit' when including remote CSS file

I have included the CDN of the bootstrap CSS in my project. Everything works absolutely fine, except when I type

<div class="

Then Visual Studio pops up an error saying:

Unable to edit 'http://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap-theme.min.css'. here`The style sheet must be part of the current project and the project must be a Web Site or Web Application project

I can hit OK to dismiss these errors, and then everything works fine as well - it reads the CSS classes and populates Intellisense and works correctly when I build. But why is Visual Studio trying to edit the remote CSS file? How can I tell it not to?

like image 595
RamblerToning Avatar asked Nov 30 '25 20:11

RamblerToning


1 Answers

I was having the same problem and a little search brought me to the following page:

http://forums.asp.net/t/1586914.aspx?Unable+to+edit+CSS+file+

In a nutshell: Add a fake parameter to the end of your CDN URL to get rid of your errors. This also makes intellisense work correctly.

Example:

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css?parameter=1" rel="stylesheet">
like image 196
Ayrab Avatar answered Dec 02 '25 11:12

Ayrab



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!