Skip to content

Suport to silverlight #22

Closed
nmocruz opened this Issue Aug 3, 2011 · 2 comments

2 participants

@nmocruz
nmocruz commented Aug 3, 2011

When a add a silverligth application a get this error

[ArgumentException: An item with the same key has already been added.]
Cassette.Web.ExceptionCachedManager.CreatePageAssetManager(HttpContextBase httpContext) +75
Cassette.Web.CassetteHttpModule.b__0(Object sender, EventArgs e) +118
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

@andrewdavey
Owner

Have you updated to Cassette.Web v0.5.4?

@nmocruz
nmocruz commented Aug 3, 2011

i got the source yesterday, and the exception happens when this call:

UnresolvedModule.css - line 115

Asset[] OrderScriptsByDependency(Asset[] assets){
var assetsByPath = assets.ToDictionary(asset => asset.Path, StringComparer.OrdinalIgnoreCase);
...
}

the assets array have 2 objects with the same path

I solve it with this :

        var assetsByPath = new Dictionary<string, Asset>();
        foreach (var item in assets)
        {
            if (!assetsByPath.ContainsKey(item.Path))
                assetsByPath.Add(item.Path, item);
        }

but I dont now if is safe.

@nmocruz nmocruz closed this Aug 3, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.