Comments (15)
Hmm, perhaps I forgot to push Cassette.Web 0.5.3 to match the core library. I've just pushed it now. Please try updating to that version.
from cassette.
Hi Andrew,
Alas, no dice. I updated to 0.5.3 but the same problem occurred. There was also an update to AjaxMin which I installed afterwards, also to no avail.
Thanks, Dan
from cassette.
It could be the web.config transform screwing things up. Take a look at web.config. Can you paste in the <cassette>
section here?
Also, there may be a conflict with AjaxMin since Cassette still targets an older version. You will probably need an assembly binding redirect for it.
from cassette.
Hi Andrew, There are no transforms on this particular web.config. If you let me know which version of AjaxMin to use, then I can set the binding redirect, test and feedback.
I haven't added anything to the views yet, but in any case, when I do, the same problem occurs.
The cassette section (unmodified after install) is below:
<cassette moduleMode="OffInDebug"> <!-- moduleMode options: OffInDebug => Modules are used when web application is not in debug mode On => Modules are always used Off => Modules are not used Cassette is all about defining "modules" of assets. So in production mode your application serves as few files as possible. Three types of module are provided by Cassette: scripts, styles and html templates. The modules are defined in the following sub-sections... --> <scripts> <!-- Script modules contain .js and .coffee files. So make sure you DELETE ALL minified JS files now! Cassette will minify for you. --> <!-- This creates a single module containing everything in "Scripts": --> <add path="Scripts" /> <!-- However, it's a good idea to separate your scripts into folders e.g. <add path="Scripts/lib" /> for jQuery and other third party script etc <add path="Scripts/app" /> for your application specific code etc... Alternatively, to define a module for each immediate sub-folder of Scripts, you can use a single <add/> with a path ending in "/*" e.g. <add path="Scripts/*" /> --> </scripts> <styles> <!-- Style modules contain .css and .less files. --> <!-- This creates a single module containing everything in "Content": --> <add path="Content" /> <!-- Alternatively you can separate your stylesheets into modules by using folders It works the same as the <scripts> section above. --> </styles> <htmlTemplates> <!-- Html template modules contain .htm and .html files. --> </htmlTemplates> </cassette>
Many thanks, Dan
from cassette.
AjaxMin v4.13
Your exception stack trace is unfortunately from when it is re-thrown. If possible tell VS to break on all thrown CLR exceptions (Debug > Exceptions...). Then see if you can grab the original stack trace.
Also, is this happening in a new project, or one that was using an older version of Cassette?
from cassette.
Andrew,
I've stepped through it without success. It leaves the application start and then falls over. Even with CLR exceptions being set to thrown, no exception is ever caught.
This isn't a new project (about two years old), and it wasn't using an older version of cassette or knapsack when I first installed it.
Other nuget packages installed include Elmah, Glimpse and Ninject. Also, redirecting the AjaxMin version to 4.13 makes no difference.
Thanks, Dan
from cassette.
Okay, we'll have to try some more serious debugging. Grab the Cassette source code and add the Cassette and Cassette.Web projects to your solution. (Removing the nuget based Cassette.Web references.) Change your web app to reference these local projects.
Then you can put a break point in: Cassette.Web/SingletonCassetteApplicationContainer.cs
line 40 (where it creates the CassetteApplication
object).
Does that get us any closer to the real exception?
from cassette.
Here's the exception I get when debugging (I've run into the same issue)
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer) at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable`1 source, Func`2 keySelector, IEqualityComparer`1 comparer) at Cassette.ModuleBuilding.UnresolvedModule.OrderScriptsByDependency(Asset[] assets) in c:\Users\tkarpinski\projects\cassette\src\Cassette\ModuleBuilding\UnresolvedModule.cs:line 116 at Cassette.ModuleBuilding.UnresolvedModule..ctor(String path, UnresolvedAsset[] assets, String location, Boolean isAssetOrderFixed) in c:\Users\tkarpinski\projects\cassette\src\Cassette\ModuleBuilding\UnresolvedModule.cs:line 40 at Cassette.ModuleBuilding.UnresolvedModuleBuilder.Build(String relativeModulePath, String location) in c:\Users\tkarpinski\projects\cassette\src\Cassette\ModuleBuilding\UnresolvedModuleBuilder.cs:line 32 at Cassette.Assets.HtmlTemplates.HtmlTemplateModuleContainerBuilder.<>c__DisplayClass2.b__0(Tuple`2 x) in c:\Users\tkarpinski\projects\cassette\src\Cassette\Assets\HtmlTemplates\HtmlTemplateModuleContainerBuilder.cs:line 17 at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() at System.Linq.Buffer`1..ctor(IEnumerable`1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) at Cassette.ModuleBuilding.UnresolvedModule.ResolveAll(IEnumerable`1 unresolvedModules) in c:\Users\tkarpinski\projects\cassette\src\Cassette\ModuleBuilding\UnresolvedModule.cs:line 58 at Cassette.Assets.HtmlTemplates.HtmlTemplateModuleContainerBuilder.Build() in c:\Users\tkarpinski\projects\cassette\src\Cassette\Assets\HtmlTemplates\HtmlTemplateModuleContainerBuilder.cs:line 18 at Cassette.CassetteApplicationBase.BuildModuleContainer(ModuleContainerBuilder builder, ModuleCollection modules) in c:\Users\tkarpinski\projects\cassette\src\Cassette\CassetteApplicationBase.cs:line 178 at Cassette.CassetteApplicationBase.BuildHtmlTemplateModuleContainer(IsolatedStorageFile storage, CassetteSection config) in c:\Users\tkarpinski\projects\cassette\src\Cassette\CassetteApplicationBase.cs:line 164 at Cassette.CassetteApplicationBase..ctor(CassetteSection configuration, String appDomainAppPath, String appDomainAppVirtualPath, IsolatedStorageFile storage) in c:\Users\tkarpinski\projects\cassette\src\Cassette\CassetteApplicationBase.cs:line 44 at Cassette.Web.CassetteApplication..ctor() in C:\Users\tkarpinski\projects\cassette\src\Cassette.Web\CassetteApplication.cs:line 16 at Cassette.Web.SingletonCassetteApplicationContainer.CreateManager() in C:\Users\tkarpinski\projects\cassette\src\Cassette.Web\SingletonCassetteApplicationContainer.cs:line 40
from cassette.
Hi Andrew,
The stack trace from the caught exception on line 40 is as follows:
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer) at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable`1 source, Func`2 keySelector, IEqualityComparer`1 comparer) at Cassette.ModuleBuilding.UnresolvedModule.OrderScriptsByDependency(Asset[] assets) in D:\Cassette\src\Cassette\ModuleBuilding\UnresolvedModule.cs:line 116 at Cassette.ModuleBuilding.UnresolvedModule..ctor(String path, UnresolvedAsset[] assets, String location, Boolean isAssetOrderFixed) in D:\Cassette\src\Cassette\ModuleBuilding\UnresolvedModule.cs:line 40 at Cassette.ModuleBuilding.UnresolvedModuleBuilder.Build(String relativeModulePath, String location) in D:\Cassette\src\Cassette\ModuleBuilding\UnresolvedModuleBuilder.cs:line 32 at Cassette.Assets.HtmlTemplates.HtmlTemplateModuleContainerBuilder.<>c__DisplayClass2.b__0(Tuple`2 x) in D:\Cassette\src\Cassette\Assets\HtmlTemplates\HtmlTemplateModuleContainerBuilder.cs:line 17 at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() at System.Linq.Buffer`1..ctor(IEnumerable`1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) at Cassette.ModuleBuilding.UnresolvedModule.ResolveAll(IEnumerable`1 unresolvedModules) in D:\Cassette\src\Cassette\ModuleBuilding\UnresolvedModule.cs:line 58 at Cassette.Assets.HtmlTemplates.HtmlTemplateModuleContainerBuilder.Build() in D:\Cassette\src\Cassette\Assets\HtmlTemplates\HtmlTemplateModuleContainerBuilder.cs:line 18 at Cassette.CassetteApplicationBase.BuildModuleContainer(ModuleContainerBuilder builder, ModuleCollection modules) in D:\Cassette\src\Cassette\CassetteApplicationBase.cs:line 178 at Cassette.CassetteApplicationBase.BuildHtmlTemplateModuleContainer(IsolatedStorageFile storage, CassetteSection config) in D:\Cassette\src\Cassette\CassetteApplicationBase.cs:line 164 at Cassette.CassetteApplicationBase..ctor(CassetteSection configuration, String appDomainAppPath, String appDomainAppVirtualPath, IsolatedStorageFile storage) in D:\Cassette\src\Cassette\CassetteApplicationBase.cs:line 44 at Cassette.Web.CassetteApplication..ctor() in D:\Cassette\src\Cassette.Web\CassetteApplication.cs:line 16 at Cassette.Web.SingletonCassetteApplicationContainer.CreateManager() in D:\Cassette\src\Cassette.Web\SingletonCassetteApplicationContainer.cs:line 40
Thanks, Dan
from cassette.
Thanks guys, that's narrowed things down. Can you see what assets are being sent to UnresolvedModule.OrderScriptsByDependency
? Somehow a duplicate file name is getting picked up.
from cassette.
it is because LoadAllFilesInModule
returns file.html for when searching extension .htm and .html. Directory.EnumerateFiles takes a pattern - file.html matches *.htm and *.html
from cassette.
Good catch @tkarpinski . I can't fix the package right now and I'm away over the weekend. For now, make this change to UnresolvedModuleBuilder.cs
IEnumerable<UnresolvedAsset> LoadAssetByFindingFiles(string modulePath)
{
return fileExtensions
.SelectMany(
extension => LoadAllFilesInModule(modulePath, extension)
)
.Distinct() // <--- Add this call
.Where(ShouldNotIgnoreAsset)
.Select(NormalizePathSlashes)
.Select(LoadAsset);
}
from cassette.
Thanks Andrew and Tod for your help on this issue.
I'll leave it until the Nuget package is deployed to check again.
Many thanks, Dan
from cassette.
Cassette.Web v0.5.4 should fix this problem. Please update and let me know. Thanks.
from cassette.
Hi Andrew, I can confirm v0.5.4 doesn't YSOD anymore.
Many thanks! Dan
from cassette.
Related Issues (20)
- Infinite loop between ExceptionCatchingBundleCollectionInitializer and BundleCollection.GetReadLock HOT 3
- Remove legacy classic pipeline web.config transforms HOT 1
- Strange behavior using Web Deploy HOT 1
- Azure + Release = 500 on cassette.axd HOT 10
- Change ID of html template
- cassette rebuild is slow HOT 1
- Sorting assets in HtmlTemplateBundles
- Cassette.RequireJS breaks with most recent version of AjaxMin
- 304 Not Modified HOT 1
- When minifing comma operator syntax, the behaviour of the minified code changes
- Cassette stripping timing units from 0 values making CSS properties invalid HOT 1
- Support "defer" and "async" on scripts
- Support ASP.NET core HOT 3
- Fonts and CSS Animations for Semantic UI not working once bundled HOT 1
- Cassette does not include files in /fonts and /images.
- Cached Manifest.xml being empty breaks website
- CSS minification breaking calc() HOT 1
- setTimeout with lambda causes incorrect minification
- Can Cassette be used in react-native?
- Could not load type 'Cassette.Trace' from assembly 'Cassette, Version=2.4.2.13844, Culture=neutral, PublicKeyToken=null'. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cassette.