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

155 views Asked by At

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

1

There are 1 answers

0
Nick Bailey On BEST ANSWER

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