google font api not working mvc bundleconfig


April 2019


421 time


I'm currently working on an ASP.NET MVC application and I'm trying to include a google font into my bundleconfig.cs.

Unfortunately it does not work as expected. I'm getting this error:

The URL ',300,400,700' is not valid. Only application relative URLs (~/url) are allowed. Parameter name: virtualPath

My current coding in RegisterBundles method in BundleConfig.cs looks like this:

    string[] libraryCssList = new string[] 
    }; // works fine

    // error begins:

bundles.UseCdn = true;

    var fontRokkittCss = ",300,400,700";

    bundles.Add(new StyleBundle("~/Content/libraryCss")

Do you know how to include google font api into a bundle config in mvc 4?

Thank you!!

0 answers