Home > Enterprise >  multiple entries in app.config or how to resolve dependency version conflict
multiple entries in app.config or how to resolve dependency version conflict

Time:09-10

I am wondering is it possible to have multiple entries in app.config file?

I think I have 2 different libraries that each one is bringing in a different version of "Microsoft.Azure.Management.ResourceManager" so I am trying to resolve them via app.config.

This is my attempt but it has a syntax error:

  <dependentAssembly>
    <assemblyIdentity name="Microsoft.Azure.Management.ResourceManager" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="3.0.0.0" newVersion="3.17.3.0" />
    <bindingRedirect oldVersion="3.13.1-preview" newVersion="3.17.3.0" />
  </dependentAssembly>

Error message:

Application Configuration file "app.config" is invalid. There was a problem parsing the oldVersion attribute. Version string portion was too short or too long.

I am also wondering can we see dependency tree (either via command line or visual studio) to see which library is bringing in "Microsoft.Azure.Management.ResourceManager"

CodePudding user response:

You can have a range instead:

<bindingRedirect oldVersion="0.0.0.0-3.17.3.0" newVersion="3.17.3.0"/>

More information here.

  • Related