Conflicting user.config due to non unique path between 2 addins

Add-in Express™ Support Service
That's what is more important than anything else

Conflicting user.config due to non unique path between 2 addins
 
Pawel Forys




Posts: 17
Joined: 2016-04-27
Hi, we are experiencing a problem described before in this thread: https://www.add-in-express.com/forum/read.php?a&FID=5&TID=13115&SHOWALL_1=0.

We have 2 add-in in our enterprise ecosystem. Addin 1. is using .NET built in configuration extensively. Addin 2. does not use user based configuration explicitly, however it does perform the Active Directory search, which for not know reason implicitly tries to read user.config .



            DirectorySearcher oSearcher = new DirectorySearcher
            {
                Filter = "(&(objectClass=user)(legacyExchangeDN=" + legaxyExchangeDn + "))",
                SearchScope = SearchScope.Subtree
            };
            oSearcher.PropertiesToLoad.Add("sAMAccountName");
            oSearcher.PropertiesToLoad.Add("mail");

            var oResult = oSearcher.FindOne();
            return oResult.Properties["mail"][0].ToString();


We use above code to retrieve the mailbox of particular email. Exception gets triggered in oSearcher.FindOne():

System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Unrecognized configuration section userSettings. (C:UsersMyUserAppDataLocalMicrosoft_CorporationC__Program_Files_(x86)_Sw_Path_pzllr20oqrn1234b3lfbn4njpshdzry
.0.4859.1000user.config line 3)


This config however contains only the setting from the Addin 1.

The problem is that Addin 2. reads Addin 1. config file because of not enough unique config location and fails to understand it. Both addins assume that path:

C:\Users\MyUser\AppData\Local\Microsoft_Corporation\C__Program_Files_(x86)_Sw_Path_pzllr20oqrn1234b3lfbn4njpshdzry\15.0.4859.1000\user.config

is dedicated for them.

Do you have any ideas how to solve this conflict properly?

Thanks and best,
Pawel
Posted 20 Oct, 2016 04:51:16 Top
Andrei Smolin


Add-in Express team


Posts: 18823
Joined: 2006-05-11
Hello Pawel,

This isn't a problem of Add-in Express. It occurs in VB.NET projects only. You need to delete the .config file; this will end with recreating it.

To avoid this, your add-ins need to have different names and locate in separate folders.


Andrei Smolin
Add-in Express Team Leader
Posted 21 Oct, 2016 05:39:28 Top