Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Finding an assembly redirection in app.config

Finding an assembly redirection in app.config

Scheduled Pinned Locked Moved XML / XSL
xmltutorialquestionannouncement
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mav northwind
    wrote on last edited by
    #1

    Hi guys! I'm looking for a way to find out if there's an assembly redirection for a given assembly in an app.config file. Let's say I have ClassLibrary1 version 1.2.0.0 and I want to find out if my app.config file already contains an assembly redirection for version 1.0.0.0 to 1.1.0.0. I'm afraid my XPath knowledge is not up to this task - I don't know how to combine conditions from different nodes. I have this XML snipplet: <dependentAssembly>    <assemblyIdentity name="ClassLibrary1" publicKeyToken="..." culture="neutral" />    <bindingRedirect oldVersion="1.0.0.0" newVersion="1.1.0.0" /> </dependentAssembly> and I want to get the dependentAssembly node with an assemblyIdentity child with @name='ClassLibrary' AND a bindingRedirect child with @oldVersion='1.0.0.0' Is this possible with XPath and if so, how? Thanks in advance

    Regards, mav -- Black holes are the places where God divided by 0...

    M 1 Reply Last reply
    0
    • M mav northwind

      Hi guys! I'm looking for a way to find out if there's an assembly redirection for a given assembly in an app.config file. Let's say I have ClassLibrary1 version 1.2.0.0 and I want to find out if my app.config file already contains an assembly redirection for version 1.0.0.0 to 1.1.0.0. I'm afraid my XPath knowledge is not up to this task - I don't know how to combine conditions from different nodes. I have this XML snipplet: <dependentAssembly>    <assemblyIdentity name="ClassLibrary1" publicKeyToken="..." culture="neutral" />    <bindingRedirect oldVersion="1.0.0.0" newVersion="1.1.0.0" /> </dependentAssembly> and I want to get the dependentAssembly node with an assemblyIdentity child with @name='ClassLibrary' AND a bindingRedirect child with @oldVersion='1.0.0.0' Is this possible with XPath and if so, how? Thanks in advance

      Regards, mav -- Black holes are the places where God divided by 0...

      M Offline
      M Offline
      mav northwind
      wrote on last edited by
      #2

      Looks as if I was just missing a small step - I think I can answer my own question :) For those interested: An XPath finding only the nodes I wanted is //assemblyIdentity[@name="ClassLibrary1"]/../bindingRedirect[@oldVersion="1.0.0.0"]/.. Nevertheless - if someone else knows a better way I'm always willing to learn.

      Regards, mav -- Black holes are the places where God divided by 0...

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups