IEModule.ModuleName vs Namespace vs AssemblyName vs God

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

IEModule.ModuleName vs Namespace vs AssemblyName vs God
AppDomain.CurrentDomain.SetupInformation.ConfigurationFile name cannot be found. 
Robert Apostolico




Posts: 70
Joined: 2013-09-06
OK. I give up. I can't figure out how/where add-in-express is controlling the name used by my add-in-module as it pertains to .NET runtime trying to access AppSettings and configuration information.

As a test, I had created entries in my App.config like:

  <appSettings>
    <add key="TestingThis" value="SanityCheck" />
  </appSettings>


and when I'd do a messagebox of it:


System.Windows.Forms.MessageBox.Show( System.Configuration.ConfigurationManager.AppSettings["TestingThis"] );


it would display an empty messagebox.

So, I went to the next step to figure out where it thought it was getting it from:


System.Windows.Forms.MessageBox.Show( "File: " + AppDomain.CurrentDomain.SetupInformation.ConfigurationFile );


This would display:
[ My code/application path ] \bin\debug\SigBOP.dll.config

I can't figure out where its getting the "truncated name" of SigBOP.dll from.

The actual name of the output/assembly file is SigBOPbrowserIE.dll
I would have expected a config file of SigBOPbrowserIE.dll.config.

But that is not the case.

I then noticed that the IEModule.ModuleName was SigBOP.
I changed it to match the Assembly name of SigBOPbrowserIE and recompile.
I still get the blank message box, followed by a message box saying its looking at SigBOP.dll.config.

Then I noticed my default namespace was SigBOP. I changed it to be SigBOPbrowserIE and recompiled.
Still getting blank message box (from my "TestingThis" test) followed by message box of SigBOP.dll.config.

HOW/WHERE do I change the name of the default configuration file used by my Add-in??

It does NOT appear to be coming from the AssemblyName, ModuleName, or Namespace.

NOTE: When I 1st started this test project, its NAME WAS "SigBOP". BUT since then I had renamed the project and its assembly name, etc. The DLL file output by the compiler is SigBOPbrowserIE.dll.

Please advise.

THANK YOU!
BApostolico
Posted 27 May, 2014 13:19:38 Top
Robert Apostolico




Posts: 70
Joined: 2013-09-06
I found the culprit, and possibly a bug.

IF a user changes the Output Assembly Name (especially on a Development System), and even right-clicks the project, builds AND executes Register ADX Project, what is stored in the registry under "InprocServer32", under CodeBase, is the name of the OLD DLL, no matter how many times you re-compile and re-register it.

You have to UN-REGISTER the project so it removed the old codebase name.

THEN you have compile and register the correct name.

THAT was a PAIN trying to find/figure that out.

I spent almost half a day on that.

It'd be nice, if when the assembly gets renamed, on the next rebuild, it puts the correct codebase out into the registry.

THANKS!
BApostolico
Posted 27 May, 2014 14:02:15 Top
Robert Apostolico




Posts: 70
Joined: 2013-09-06
Ok. I spoke too soon.
It appears that either God or Add-in-Express is still in control of the Configuration File name.

Check out the below screen shots.

HERE: you can see that the Correct/new name is what is in the registry >>
User added an image

HERE: you can see that the MessageBox is still displaying the OLD configuration name >>
User added an image

Where do I look to next?

Assembly Name is SigBOPbrowserIE
Default Namespace is SigBOPbrowserIE
Name of the PROJECT is SigBOP IE extension.csproj
The output files are SigBOPbrowserIE.dll, SigBOPbrowserIE.dll.config,
SigBOPbrowserIE.pdb, SigBOPbrowserIE.tlb

WHY is it thinking the configuration file is SigBOP.dll.config ???????

(Most of the day has now been lost trying to figure this one problem out).
BApostolico
Posted 27 May, 2014 15:10:02 Top
Andrei Smolin


Add-in Express team


Posts: 14127
Joined: 2006-05-11
Hello Robert,

Check the configFileName attribute in adxloader.dll.manifest. When Add-in Express creates an AppDomain for your add-on, the name of the .config file is taken from that attribute.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 29 May, 2014 01:52:43 Top
Robert Apostolico




Posts: 70
Joined: 2013-09-06
Andrei,

Thank you.

Here's my suggestion/request:

If I go into my Project's Properties page, and change the Assembly name to "BobWasHere" and recompile, the add-in-express adxloader.dll.manifest (in the Loader and the bin\debug folder) looks like this:


<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <assemblyIdentity name="BobWasHere, PublicKeyToken=72be693171934a77" />
  <loaderSettings generateLogFile="true" shadowCopyEnabled="false" privileges="administrator" configFileName="SigBOP.dll.config" handleDocumentUICommands="true" handleHTTPNegotiations="false" />
</configuration>


It would seem to me, to make sense, since Add-In-Express is automatically updating the assemblyIdentity name in its manifest, to automatically update the configFileName.

I'm sure I'm mistaken, but I can't think of an example where I'd want it to be different, since, in my example, having it different causes problems. If there are special odd-ball cases where it needs to be different, then have the special odd-balls take the extra steps. :)

Thank you again.
BApostolico
Posted 29 May, 2014 07:10:39 Top
Andrei Smolin


Add-in Express team


Posts: 14127
Joined: 2006-05-11
)))

We will think about this.


Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 29 May, 2014 07:39:17 Top