[SOLVED] Asp.net Error while trying to create a bundle – Only application relative URLs (~/url) are allowed

Issue

I am getting an error, when trying to include a css file in the bundle, it says that Asp.net MVC Bundle - Only application relative URLs (~/url) are allowed.

Here is the code:

bundles.Add(new StyleBundle("~/bundles/lib/anim_css").Include(
                "~Vendor/lib/animate/animate.min.css", new CssRewriteUrlTransform()));

Where the Vendor folder is the source folder of that css. That folder is included in the project, being like that …ProjectFolderName/Vendor

This did not help

Solution

~Vendor/lib/animate/animate.min.css is not a legal relative URL. It needs to be ~/Vendor/lib/animate/animate.min.css

Answered By – Nick Bailey

Answer Checked By – Marilyn (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *