jfrancoeur
Posts: 2
Joined: Wed Mar 28, 2018 4:46 pm

Cannot update existing web.config

Hi!

We made many tests, read everything we found on the forum, we are still unable to update the web.config correctly.
We have an existing web.config containing some bindingRedirect nodes. We want to update the oldVersion & newVersion attributes values.
The MSI doesn't update the web.config correctly, it makes very strange updates inside the web.config file.
We send you an Advanced Installer project containing only the web.config file to update. The archive also contains the result files.

In short before:
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>

after:
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"/>

Shoud be only this with no other change:
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>

Can you please show us how we can made this very simple update?
Thank you in advance,
Jean Francoeur
Attachments
TestWebConfig.zip
(12 KiB) Downloaded 222 times
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Cannot update existing web.config

Hi and welcome to our forums.

Please read the "XML edit modifies when it shouldn't" tread which debates the same problem.

Let me know if you have other questions.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jfrancoeur
Posts: 2
Joined: Wed Mar 28, 2018 4:46 pm

Re: Cannot update existing web.config

Hi!

In our case, the elements have the same paths, the same names *and* the same value attribute values. So, by marking them like an identfier doesn't help either. There is any way to deal with this scenario? If we missed something, can you please shows us how to do it?

Thank you in advance,
Jean Francoeur
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Cannot update existing web.config

Hi Jean,

Just go to all the following elements and set the "Is identifier attribute" option for the "oldVersion" attribute:

Code: Select all

configuration\runtime\assemblyBinding\dependentAssembly\bindingRedirect
Let me know if this worked.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”