wont run except on dev machine. wont debug on dev machine

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

wont run except on dev machine. wont debug on dev machine
cannot get add-in to run anywhere but dev machine, and cant debug 
Nick Franceschina




Posts: 13
Joined: 2009-04-20
OK... here's the story:

-development machine is Vista 64bit Ultimate, Office 2007. I'm using Visual Studio 2008, .NET 3.5

-I built the tool originally using plain VSTO... and it worked on my machine, but I couldn't get it to run on any other machine. It would install, but in the "Excel Options > Add-Ins > Manage COM Add-In" I kept getting the dreaded: "run-time error occurred loading COM add-in." I researched and tried a hundred different things to no avail. So I decided to get AddIn Express, because in the past I've learned there are lots of little tricky details involved in making these suckers work, and AddIn Express has usually solved them for me

-I downloaded the latest AddIn Express just yesterday, and moved my code over. I have it set to install for single user and it is UAC aware. I have a single Ribbon Tab/Ribbon Group with several basic buttons/editboxes/checkboxes/dropdowns... nothing fancy. When I run the installer on my dev box, it works just fine.


PROBLEM #1:

-I have set my debug environment to launch Excel when I hit F5, but when I do so, there is no Add-In. If I run the installer, and then run Excel separately... I see the Add-In. how do I debug it?

-on my dev machine I can run the installer and see the add-in and use it. but I have been unable to install it on any of my client's XP boxes. I get the same "run-time error occurred loading COM add-in" anywhere other than my dev box (so far).



SOOOOOoooo....

where do I start, guys?


Thanks,
-Nick Franceschina







Posted 20 Apr, 2009 12:05:43 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hello Nick,

To run Excel when you hit F5, specify the path to Excel.exe in the Start External Program field, see the Properties of your project.

To solve the second problem, please check adxloader.log located in My Documents \ Add-in Express just after you install your add-in. Does it contain any errors?


Andrei Smolin
Add-in Express Team Leader
Posted 20 Apr, 2009 12:21:41 Top
Nick Franceschina




Posts: 13
Joined: 2009-04-20
Andrei

1) Sorry, I must not have been clear. Debugging is setup to launch Excel already... and it does so... but when it comes up, there is no add-in. so let me say it explicitly: I have the path to excel.exe in the "Start External Program" field... and when I hit F5 Excel does come up... but the ribbon tab does not show.


2) all looks well in the adxloader.log. I recreated the project in VS2005 just to see if that mattered... so below is the setup using .NET 2.0... but there are still no errors:


Add-in Express Loader Log File: 04/20/2009 12:17:55

Startup directory: C:\Documents and Settings\nfrances\Application Data\Default Company Name\STExcelAddinSetup\
Loader version: 4.4.1913
------------------
12:17:55 336 Starting the add-in registration process.
12:17:55 336 Loading the latest CLR version.
12:17:55 336 The CLR v2.0.50727 has been initialized successfully.
12:17:55 336 Creating a new domain setup.
12:17:55 336 Success.
12:17:55 336 Getting the add-in directory.
12:17:55 336 Success. The directory is 'C:\Documents and Settings\nfrances\Application Data\Default Company Name\STExcelAddinSetup\'
12:17:55 336 The configuration file is 'C:\Documents and Settings\nfrances\Application Data\Default Company Name\STExcelAddinSetup\app.config'
12:17:55 336 The 'shadow copy' is disabled.
12:17:55 336 Creating a new application domain.
12:17:55 336 Success.
12:17:55 336 Getting the base directory for the domain.
12:17:55 336 Success. The directory is 'C:\Documents and Settings\nfrances\Application Data\Default Company Name\STExcelAddinSetup\'.
12:17:55 336 Seaching for the Add-in Express core library.
12:17:55 336 Success. The 'AddinExpress.MSO.2005.dll' file has been found.
12:17:55 336 Creating an instance of the 'AddinExpress.MSO.ADXLoaderSupport' class.
12:17:55 336 Assembly identity is 'AddinExpress.MSO.2005'.
12:17:56 336 Success.
12:17:56 336 Unwrapping the instance of the 'AddinExpress.MSO.ADXLoaderSupport' class.
12:17:56 336 Success.
12:17:56 336 Creating an instance of the XML parser class.
12:17:56 336 Success.
12:17:56 336 Loading the manifest file (C:\Documents and Settings\nfrances\Application Data\Default Company Name\STExcelAddinSetup\adxloader.dll.manifest).
12:17:56 336 Success.
12:17:56 336 Getting the root element of the manifest (C:\Documents and Settings\nfrances\Application Data\Default Company Name\STExcelAddinSetup\adxloader.dll.manifest).
12:17:56 336 Success.
12:17:56 336 Getting the 'assemblyIdentity' element of the manifest (C:\Documents and Settings\nfrances\Application Data\Default Company Name\STExcelAddinSetup\adxloader.dll.manifest).
12:17:56 336 Success.
12:17:56 336 Seraching fo the 'name' attribute of the 'assemblyIdentity' element.
12:17:56 336 Success. The name is 'STExcelAddin, PublicKeyToken=0c4a38e6c6cc840d'.
12:17:56 336 Calling the managed procedure to register the 'STExcelAddin, PublicKeyToken=0c4a38e6c6cc840d' assembly.
12:17:56 1008 Connecting to the application domain of the Add-in Express loader.
12:17:56 1008 Success.
12:17:56 1008 Loading the 'STExcelAddin, PublicKeyToken=0c4a38e6c6cc840d' assembly.
12:17:56 1008 Success.
12:17:56 1008 Registering the 'STExcelAddin, PublicKeyToken=0c4a38e6c6cc840d' assembly (user).
12:17:56 1008 Registering the 'STExcelAddin.AddinModule' type.
12:17:56 1008 Searching for static methods that contain the 'ComRegisterFunction' attribute.
12:17:56 1008 Calling the 'AddinRegister' static method.
12:17:56 1008 The 'STExcelAddin.AddinModule' type has been registered successfully.
12:17:56 1008 The ' STExcelAddin, PublicKeyToken=0c4a38e6c6cc840d' assembly has been registered successfully.
12:17:56 1008 The managed registration process is complete with HRESULT = 0.
12:17:56 336 The add-in registration process is complete with HRESULT = 0.

Posted 20 Apr, 2009 13:29:58 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Nick,

1) It looks like you forgot to register it in the Build menu.

2) Do you have custom code in the constructor of the add-in module? If so, try moving it to the AddinInitialize event.


Andrei Smolin
Add-in Express Team Leader
Posted 20 Apr, 2009 13:44:15 Top
Nick Franceschina




Posts: 13
Joined: 2009-04-20
Andrei,

1) that was it. thank you.

2) no custom code in constructor:

public AddinModule()
{
InitializeComponent();
// Please add any initialization code to the AddinInitialize event handler
}

Posted 20 Apr, 2009 14:11:12 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Nick,

Does a sample add-in work on those PCs?


Andrei Smolin
Add-in Express Team Leader
Posted 20 Apr, 2009 15:05:13 Top
Nick Franceschina




Posts: 13
Joined: 2009-04-20
Andrei,

thanks for helping thus far. I dont know what's going on... I'm pulling my hair out.

-I downloaded your Excel Toys sample .exe and installed it... and it shows up on all computers (of course)
-I downloaded the source, but there was no setup program and I didn't want to try and add one from scratch because it wouldn't be a good test
-I noticed that the Excel Toys sample doesn't use a ribbon tab, but instead uses a command bar and sets the "Use as ribbon" flag instead
-so I made a super simple add-in with that same format... I put a single command bar on it with a single button... compiled it... and:

1) it works on my dev machine, of course
2) it is working on other machines that have Office 2000 and Office 2003
3) but ALAS... I get the same error on these Office 2007/XP machines... COM error loading


I zipped up my super-simple project with a single button on a single command bar:
http://franceschina.net/software/STAddInTest.zip

this will not load on the XP/Office 2007 machines I am trying... other than my dev box.

do you see any reason why this one wouldn't work, but the Excel Toys sample would? I have been doing diffs... but nothing is jumping out at me...


Thank you much,
-Nick
Posted 20 Apr, 2009 17:46:52 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Nick,

I've installed it successfully on a PC having WinXP SP3 + Office 2007 SP1. Do you run setup.exe or .msi to install it? Does it produce an error-free log after installation? Are there any errors in the log after you start Excel?


Andrei Smolin
Add-in Express Team Leader
Posted 21 Apr, 2009 06:42:56 Top
Nick Franceschina




Posts: 13
Joined: 2009-04-20
Andrei, sorry... I'm getting the hang of this now. I didn't realize that you're always logging to that adxloader.log. here's the latest, with an error code at the end. I have been trying to run caspol on these things to see if it's a permissions problem, but nothing is happening.

also... I just realized that at this company all of the "My Documents" folders are mapped to a fileshare. So the install directory is local:
C:\Documents and Settings\nfrances\Application Data\Default Company Name\STAddInTestSetup

but the logging directory (which is under "My Documents") is located on a share:
\\mainserver-vm1\users\nfrances\Add-in Express

I thought that might matter... but the add-in is installing on the XP machine running Office 2000. It continues to "look like" an office 2007 issue on these machines.

here's the log

=====================================
Add-in Express Loader Log File: 04/21/2009 11:34:52

Startup directory: C:\Documents and Settings\nfrances\Application Data\Default Company Name\STAddInTestSetup\
Loader version: 4.4.1913
------------------
11:34:52 2012 Start.
11:34:52 2012 Reading the registry key 'HKEY_CLASSES_ROOT\CLSID\{B1E4FA39-A6C5-420E-B008-6F9A22C2B1C7}'
11:34:52 2012 Success. The registry key 'HKEY_CLASSES_ROOT\CLSID\{B1E4FA39-A6C5-420E-B008-6F9A22C2B1C7}' is closed.
11:34:52 2012 Converting the '{4BA250A6-8BCA-46A6-982A-F340081187C3}' CLSID from string.
11:34:52 2012 Success.
11:34:52 2012 Attempting to get the class object by the '{4BA250A6-8BCA-46A6-982A-F340081187C3}' CLSID.
11:34:52 2012 Success.
11:34:52 2012 Creating a new instance of the add-in loader.
11:34:52 2012 Success.
11:34:52 2012 Loading the configuration from the system registry.
11:34:52 2012 Getting the lates CLR version.
11:34:52 2012 The latest CLR version is 'v2.0.50727'.
11:34:52 2012 The configuration has been loaded successfully.
11:34:52 2012 Runtime version: v2.0.50727.
11:34:52 2012 Assembly name: STAddInTest, PublicKeyToken=3CFA8DB118647E66.
11:34:52 2012 Class name: STAddInTest.AddinModule.
11:34:52 2012 Attempting to create a new instance of the managed add-in class: CLR - v2.0.50727
11:34:52 2012 Loading CLR: v2.0.50727.
11:34:52 2012 The CLR v1.1.4322 has been initialized successfully.
11:34:52 2012 Creating a new domain setup.
11:34:52 2012 Success.
11:34:52 2012 Getting the add-in directory.
11:34:52 2012 Success. The directory is 'C:\Documents and Settings\nfrances\Application Data\Default Company Name\STAddInTestSetup\'
11:34:52 2012 The configuration file is 'C:\Documents and Settings\nfrances\Application Data\Default Company Name\STAddInTestSetup\\app.config'
11:34:52 2012 The 'shadow copy' is enabled.
11:34:52 2012 Creating a new application domain.
11:34:52 2012 Success.
11:34:52 2012 Error code: 0x80131107
Posted 21 Apr, 2009 12:49:07 Top
Nick Franceschina




Posts: 13
Joined: 2009-04-20
googling "Error code: 0x80131107" looks like perhaps my .NET install is misconfigured in some way. i'm downloading latest service packs and reinstalling...



Posted 21 Apr, 2009 13:17:13 Top