Cannot find an asset bundle containing the path

1,505 views
Skip to first unread message

Hhrvoje

unread,
Dec 29, 2011, 5:09:21 PM12/29/11
to Cassette
I added Cassette to my MVC 3 project, and no mater what i do, i always
get:

Cannot find an asset bundle containing the path "~/Content/Site.css".

Source Error:
Line 1: @{
Line 2: Bundles.Reference("/Content/Site.css");

I removed all setting from Cassette.Config.cs file, I don't want
automatic discovery of files in folders.

That css file is there, I can access it by typing URL, so don't
understand why cassette doesn't see it?

Also, how should I reference .min.js and .min.css files, for which I
don't have no-min versions?

thanx!

John Welborn

unread,
Dec 30, 2011, 9:08:54 AM12/30/11
to Cassette
I think in your App_Code/CassetteConfiguration.cs file you still have
to add this

bundles.AddPerIndividualFile<StylesheetBundle>("Content");

Then it will create a bundle for each file. You still have to tell it
to create the bundle before you can use it.

You can go to http://localhost/_cassette to see the dashboard. That
will let you see what bundles are defined.

Andrew Davey

unread,
Jan 3, 2012, 9:04:07 AM1/3/12
to cass...@googlegroups.com
John is correct, you must have a CassetteConfiguration class to tell Cassette which assets to create bundles from.
Cassette's Bundle.Reference helper only finds defined bundle and asset paths.

Existing .min.js and .min.css will be used by Cassette. The real issue is that if there are both min and non-min files present, both currently get included in bundles. I'll be addressing this issue in v1.1. For now either delete the duplicate files, or use a custom FileSearch object in bundles.Add(...) to exclude the files.
Reply all
Reply to author
Forward
0 new messages