Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening bootstrap.min.css crashes VS2010

Any idea why opening up a minified version of bootstrap.min.css would crash VS2010? It doesn't happen with non-minified file. I know... I know.. a valid solution might be "don't open up bootstrap.min.css in VS2010"-- which is similar advice I got when I told my doctor that it hurts me "when I do this"-- but seriously folks, is there some known issue with VS2010. I'm thinking maybe it's also got something to do with resharper running- but I have yet to dig that deep.

Edit: Actually found this: http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2422744-when-opening-a-large-minimized-css-file-visual-st

If this is correct, this was fixed in VS2010.

like image 784
ek_ny Avatar asked Jun 06 '13 12:06

ek_ny


3 Answers

I know where you're coming from, because I've had the same problem.

In the visualstudio uservoice link, Mads K. says, "This is fixed in VS11". So the fix is in Visual Studio 2012, not in VS2010.
https://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Version_history

However, might I suggest another method of attacking the problem?

Completely ignore the .min file.

Completely ignore it, because:
(1) The .min css file, even when we do want to edit it, is a pain to edit. At least that has been my experience.
(2) If you use the Microsoft ASP.NET Web Optimization Framework, you can use bundling and minification, so then there is no need to work with .min files, because the Optimization framework will do the minification for you, even in VS2010 .NET 4.0. Then you can edit the un-minified .css file, and let .NET do the minification for you. It's a win-win from my perspective.

One thing to keep in mind if you should happen to have a bunch of stylesheets with a bunch of rules that you want to bundle into one single .css file are the limitations of Internet Explorer: http://support.microsoft.com/kb/262161.

Some relevant posts:
1. http://kwilson.me.uk/blog/enabling-bundling-and-minification-support-in-a-net-4-application/
2. http://igorzelmanovich.blogspot.com/2012/09/using-aspnet-bundling-and-minification.html
3. http://www.dotnet-tricks.com/Tutorial/mvc/0a9M050113-Bundling-and-minification-in-MVC3-and-Asp.Net-4.0.html

like image 66
mg1075 Avatar answered Nov 11 '22 18:11

mg1075


I use gedit on linux and the same problem occurs with the .min file.

The reason for the crashing is not the text, but rather your text editor attempting to beautify your code. It gets very confused with the lack of formatting and craps out. Use the regular stylesheet unless .min.css is absolutely necessary.

like image 45
RyanP Avatar answered Nov 11 '22 19:11

RyanP


You should format your css. just find one of the many available css formatter web sites like http://www.cleancss.com/css-beautify/. if you paste to formatted css it will work on vs2010 and vs2015. I solved it couple of times that way.

enter image description here

enter image description here

like image 38
JOZO Avatar answered Nov 11 '22 17:11

JOZO