Code Monkey home page Code Monkey logo

Comments (6)

andrewdavey avatar andrewdavey commented on July 23, 2024

What is the correct way to tell nuget that I want the Cassette package to depend on AjaxMin v4 and greater?

It seems like the default behaviour is "ha ha you lose" :( #confused

from cassette.

smnbss avatar smnbss commented on July 23, 2024

if you compiled against v 4.13, but you want to use it with 4.19 you have to use assembly binding to tell you apppool to look for the newer version of the dependency

http://msdn.microsoft.com/en-us/library/2fc472t2(v=vs.71).aspx

something like

<runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly> 
               <assemblyIdentity name="AjaxMin" publicKeyToken="b03f5f7f11d50a3a" culture=""/>
                <bindingRedirect oldVersion="0.0.0.0-4.18.0.0" newVersion="4.19.0.0"/>
            </dependentAssembly>
       </assemblyBinding>
</runtime>

from cassette.

kaatula avatar kaatula commented on July 23, 2024

andrewdavey,

I believe the problem was not with nuGet, but with assembly references; maybe it makes sense to advice compiler to use any dll with "SpecificVersion" element in project file, such as:

<Reference Include="AjaxMin, Version=4.19.4141.18463, Culture=neutral, PublicKeyToken=24297a69a7eae424, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>....\Solution\Usadba\packages\AjaxMin.4.19.4141.18463\lib\AjaxMin.dll</HintPath>
</Reference>

I found this stackoverflow question about this topic:
http://stackoverflow.com/questions/1063459/net-reference-specificversion-true-or-false

But I'm afraid to say I have a problem with reproducing this issue... right now Cassette works just fine with AjaxMin 4.19 both on Dev and Staging (win 2008) environment. Can't say what changed...

smnbss,
Thank you for advice, but such way of assemble redirection should be set in every Web.config in every project which uses Cassete, which can be a bit boring :)

from cassette.

smnbss avatar smnbss commented on July 23, 2024

It can be done by the same merge that adds the configuration for cassette to the web.config. I've seen other NuGet packages working like that.

sometimes the problem happens if you reference 3rd party libraries that reference a specific version of a dll, while you reference a different version from your library. it can get quite complex, so assemblyBinding solve the problem in that specific case

from cassette.

andrewdavey avatar andrewdavey commented on July 23, 2024

Can the binding redirect specify a non-fixed upper bound? Otherwise we have the same problem when AjaxMin gets updated to a new version and the redirect still points to an older version.

I will have a look at setting Specific Version = False and changing the AjaxMin dependency to something like [4-5). Since I'd rather let nuget satisfy the versioning.

from cassette.

kaatula avatar kaatula commented on July 23, 2024

I was not right in my comment below, the reference which I quoted is actually going to point only 4.19 always (it appears SpecificVersion works only on compile time, not execution-and-assembly-search time)

Maybe it makes sense to make a reference in csproj file without versions at all:

  <Reference Include="AjaxMin">
      <HintPath>....packages\AjaxMin.4.13.4076.28499\lib\AjaxMin.dll</HintPath>
  </Reference>

(with no version at all)
I also agree that it's better to let NuGet care about setting minimal required version.

Thanks

from cassette.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.