andrewdavey / cassette

Manages .NET web application assets (scripts, css and templates)
http://getcassette.net
MIT License
536 stars 144 forks source link

AjaxMin Version Dependency in Nuget #409

Open SeriousM opened 11 years ago

SeriousM commented 11 years ago

Cassette has a AjaxMin dependency on version 4.84 or greater. image

I was updating AjaxMin to the latest version (4.97.4951.28483) and get an assembly load error:

System.Exception: Bundle collection rebuild failed. See inner exception for details. ---> 
Cassette.TinyIoC.TinyIoCResolutionException: Unable to resolve type: Cassette.BundleProcessing.IBundlePipeline`1[[Cassette.Scripts.ScriptBundle, Cassette, Version=2.2.2.34609, Culture=neutral, PublicKeyToken=null]] ---> 
Cassette.TinyIoC.TinyIoCResolutionException: Unable to resolve type: Cassette.Scripts.ScriptPipeline ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> 
Cassette.TinyIoC.TinyIoCResolutionException: Unable to resolve type: Cassette.Scripts.IJavaScriptMinifier ---> System.IO.FileLoadException: Could not load file or assembly 'AjaxMin, Version=4.84.4790.14405, Culture=neutral, PublicKeyToken=21ef50ce11b5d80f' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I figured out that cassette has a fix version dependency! image

I tried to add a <bindingRedirect> like that into my web.config with success:

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="AjaxMin" publicKeyToken="21ef50ce11b5d80f" />
            <bindingRedirect oldVersion="4.84.4790.14405" newVersion="4.97.4951.28478" />
        </dependentAssembly>
    </assemblyBinding>
    <legacyHMACWarning enabled="0" />
</runtime>

To bypass this workaround please remove the version-dependency from Cassette to AjaxMin because many people don't know how to deal with this Problem and the documentation doesn't tell anything about that.

Thanks

Btw: the steps above were discovered during writing the issue. It's an example how long one will need to get around that.

mshwery commented 11 years ago

+1. No version AjaxMin 4.84.4790.14405 can be found via NuGet.

SeriousM commented 11 years ago

+1. No version AjaxMin 4.84.4790.14405 can be found via NuGet.

yep, thats true! Didn't recognized that during my writing. https://www.nuget.org/packages/AjaxMin/

TheCloudlessSky commented 10 years ago

:+1:

dev-arjunan commented 5 years ago
<assemblyIdentity name="AjaxMin" publicKeyToken="21ef50ce11b5d80f" />

SeriousM You saved my life today. I'm using version AjaxMin 5.14.5506.26196. I'm getting the sae issue that you have mentioned.Thanks a lot

SeriousM commented 5 years ago

I'm glad to hear that this is still saving lifes 😅