Friday, 15 February 2013

asp.net - Minification failed. Returning unminified contents -



asp.net - Minification failed. Returning unminified contents -

i have made first website using mvc 5 works fine on local machine when publish server of css not loading correctly.

/* minification failed. returning unminified contents. (80,1): run-time error css1019: unexpected token, found '@import' (80,9): run-time error css1019: unexpected token, found 'url('../content/dark-skin/skin.css')' (671,16): run-time error css1062: expected semicolon or closing curly-brace, found ':' (1288,16): run-time error css1062: expected semicolon or closing curly-brace, found ':' (1680,1): run-time error css1019: unexpected token, found '@keyframes' (1682,5): run-time error css1062: expected semicolon or closing curly-brace, found '50%' (1685,1): run-time error css1019: unexpected token, found '@-webkit-keyframes' (1687,5): run-time error css1062: expected semicolon or closing curly-brace, found '50%' */ /* nuget: begin license text * * microsoft grants right utilize these script files sole * purpose of either: (i) interacting through browser microsoft * website or online service, subject applicable licensing or utilize * terms; or (ii) using files included microsoft product subject * product's license terms. microsoft reserves other rights * files not expressly granted microsoft, whether implication, estoppel * or otherwise. notices , licenses below informational purposes only. * * nuget: end license text */ /*! * bootstrap v3.0.0 * * copyright 2013 twitter, inc * licensed under apache license v2.0 * http://www.apache.org/licenses/license-2.0 * * designed , built love in world @mdo , @fat. *//*! normalize.css v2.1.0 | mit license | git.io/normalize */

i understand compiler trying minimize css files failing so. tried right errors after correcting of them , publishing 1 time again error looks same, not picking changes.

even strangest thing bootstrap.css file have modified purpose of website. when publish changes not in bundle file. possible bootstrap loaded bootstrap server advertisement not project?

bundles.add(new stylebundle("~/content/cssmain").include( "~/content/bootstrap.css", "~/content/site.css", "~/content/ilightbox.css", "~/content/bannerscollection_zoominout.css"));

i have tried minification myself using web application changes not visible , files looks not minificated.

any help appreciated

i resolved problem bundling bootstrap.css doing 2 things:

include bootstrap.css first in bundle. code sample in question this, not. add official minified version (bootstrap.min.css) project in same directory unminified version. prompts bundler utilize existing minified file instead of trying (and failing) minify bootstrap.css itself. see greenish arrow in screenshot below.

note if using specific theme, substitute bootstrap.css , bootstrap.min.css files provided theme. here's working code project uses spacelab theme:

bundles.add(new stylebundle(getstylebundlepath("bootstrap")).include( "~/content/3rdparty/bootstrap.spacelab.css", "~/content/3rdparty/bootstrap-datepicker.css", "~/content/3rdparty/bootstrap-multiselect.css"));

asp.net asp.net-mvc

No comments:

Post a Comment