0

BundleConfig.cs

bundles.Add(new StyleBundle("~/Content/styles").Include(
   "~/Content/css/test.css"
   )
);

_Layout.cshtml

@Scripts.Render("~/Content/styles")

Test.css

body{
font-size: 75%;
color: #232323;
text-align: left;
margin: 0px;
padding: 0px;}

This is what Chrome shows as being loaded giving me a Syntax Error about an unexpected token { :

body{font-size:75%;color:#232323;text-align:left;margin:0;padding:0}
RHarris
  • 10,641
  • 13
  • 59
  • 103

1 Answers1

5

I would've selected Abi's answer for the link he provided, but it was a comment rather than an answer. So, I'm posting this as the answer to ensure this question is marked as resolved.

Basically, the link Abi provided stated that the reason for the error is that the browser was trying to load css as though it was javascript.

I realized right away that I was using @Scripts.Render() and should've been using @Styles.Render() instead.

RHarris
  • 10,641
  • 13
  • 59
  • 103
  • Oh my... HAHAHA! I was getting so pissed and blaming Visual Studio! Styles... not scripts!!!!!! – J-Roel Aug 07 '18 at 22:59