Hi all,
I have been experiencing a problem since changing over to NetOffice with my COMAddin, but only for some users who were using the VSTO version of the addin. Developed using Visual Studio 2010 SP1, Visual Studio generated msi, and Wix bootstrapper to deal with 32 and 64 bit Office versions, it's an addin for PowerPoint.
The issue is when loading the addin in PowerPoint is "Location: mscoree.dll. Load behavior: Not loaded. A runtime error occurred during the loading of the COM Add-in." Registry setting for the Addin's LoadBehavor changes from 3 to 2.
I have researched for months and applied so many of the suggested changes from msdn, stackexchange and codeplex that I am now out of ideas and perplexed as to what else I need to do to get it working. Users uninstall the old version and deploy the new NetOffice version and then the addin never works again. Here's some details of the things I've implemented or changed to get it working but without success. The only way to solve is for the user to get a new computer, so assume it's an issue that is resolvable in the registry/file system/GAC/CLR/Shim/Fusion/etc.
Bootstrapper details
- Two Wix bootstrappers developed one a current user install and another for an all user install.
- Each boostrapper detects whether 32bit or 64bit Office is installed and calls either the embedded 32 or 64 bit msi installer.
- End user is given one bootstrapper or the other
=> No issues here from Wix install logs.
msi installer
- four msi installers built an included in the two bootstrappers, one for each office bitness and All User (UAC prompt)/Current install (no UAC prompt) option
- The Target Platform set specifically to x86 or x64, rather than AnyCPU to avoid issues of incompatible bitness with office bitness
- Registry entries seem to be deployed to the correct places for both the Current User and All User installs
- Files are deployed to the correct place for the Current User (C:\Users\xxx\AppData\Local\MyAppName\AppName.dll + NO DLLs
- Files are deployed to the correct place for the All Users (C:\Users\Public\Documents\MyAppName\AppName.dll + NO DLLs
- msi's are signed and timestamped
- MyApp DLLs are strong named and signed
=> Files and registry entries seem to be in correct locations for all of the four MSIs
Addin code:
- ComVisible flags set to true for the class and main project, and other classes as required, false for everything else
- The addin Inherits COMAddin Implements Office.IRibbonExtensibility, IDTExtensibility2
- OnConnection code is in a try/catch statement and debugs/exceptions written to text file
=> Code is working fine for most users, but some who had the old addin installed never have the first line of the code executed
Startup
- Netoffice and MyApp addin's DLLs and dependencies (resources and XML serializers) are being loaded correctly as reported by Fusion (Default)
- Some errors reported by Fusion for Native Issue, but apparently these should be ignored?? (http://stackoverflow.com/questions/9734919/what-is-this-fusion-log-saying - see Hans Passant response)
- if the DLLs are not found, even a probe file for POWERPNT.EXE.config to find the correct DLLs is in place and Fusion reports successes, but even when the DLLs are found the addin still doesn't load
- The first line of OnConnection code does not seem to execute on computers with issues
- LoadBehavor is changed from 3 to 2 and error " Load behavior: Not loaded. A runtime error occurred during the loading of the COM Add-in". Addin is not in disabled items - just not ticked to load anymore on startup.
Some things that may be outstanding for consideration or comment:
- Cached versions of old dlls causing - how to find/remove them to ensure there is not some conflict 9even though the probe file should point the CLR to the right location?
- Use of the GAC? But if all DLLs are loaded assume this is not required? GAC also breaks ability to run a the No Admin installer
- Shim issues - if the DLLs are being loaded and the first line of code is not executing, could it be something in between like Shim?
- Any other suggestions related to an addin working on VSTO and then changing to Netoffice that I need to take into account?
Any assistance or pointers appreciated.
Comments: ** Comment from web user: ekirk0 **
I have been experiencing a problem since changing over to NetOffice with my COMAddin, but only for some users who were using the VSTO version of the addin. Developed using Visual Studio 2010 SP1, Visual Studio generated msi, and Wix bootstrapper to deal with 32 and 64 bit Office versions, it's an addin for PowerPoint.
The issue is when loading the addin in PowerPoint is "Location: mscoree.dll. Load behavior: Not loaded. A runtime error occurred during the loading of the COM Add-in." Registry setting for the Addin's LoadBehavor changes from 3 to 2.
I have researched for months and applied so many of the suggested changes from msdn, stackexchange and codeplex that I am now out of ideas and perplexed as to what else I need to do to get it working. Users uninstall the old version and deploy the new NetOffice version and then the addin never works again. Here's some details of the things I've implemented or changed to get it working but without success. The only way to solve is for the user to get a new computer, so assume it's an issue that is resolvable in the registry/file system/GAC/CLR/Shim/Fusion/etc.
Bootstrapper details
- Two Wix bootstrappers developed one a current user install and another for an all user install.
- Each boostrapper detects whether 32bit or 64bit Office is installed and calls either the embedded 32 or 64 bit msi installer.
- End user is given one bootstrapper or the other
=> No issues here from Wix install logs.
msi installer
- four msi installers built an included in the two bootstrappers, one for each office bitness and All User (UAC prompt)/Current install (no UAC prompt) option
- The Target Platform set specifically to x86 or x64, rather than AnyCPU to avoid issues of incompatible bitness with office bitness
- Registry entries seem to be deployed to the correct places for both the Current User and All User installs
- Files are deployed to the correct place for the Current User (C:\Users\xxx\AppData\Local\MyAppName\AppName.dll + NO DLLs
- Files are deployed to the correct place for the All Users (C:\Users\Public\Documents\MyAppName\AppName.dll + NO DLLs
- msi's are signed and timestamped
- MyApp DLLs are strong named and signed
=> Files and registry entries seem to be in correct locations for all of the four MSIs
Addin code:
- ComVisible flags set to true for the class and main project, and other classes as required, false for everything else
- The addin Inherits COMAddin Implements Office.IRibbonExtensibility, IDTExtensibility2
- OnConnection code is in a try/catch statement and debugs/exceptions written to text file
=> Code is working fine for most users, but some who had the old addin installed never have the first line of the code executed
Startup
- Netoffice and MyApp addin's DLLs and dependencies (resources and XML serializers) are being loaded correctly as reported by Fusion (Default)
- Some errors reported by Fusion for Native Issue, but apparently these should be ignored?? (http://stackoverflow.com/questions/9734919/what-is-this-fusion-log-saying - see Hans Passant response)
- if the DLLs are not found, even a probe file for POWERPNT.EXE.config to find the correct DLLs is in place and Fusion reports successes, but even when the DLLs are found the addin still doesn't load
- The first line of OnConnection code does not seem to execute on computers with issues
- LoadBehavor is changed from 3 to 2 and error " Load behavior: Not loaded. A runtime error occurred during the loading of the COM Add-in". Addin is not in disabled items - just not ticked to load anymore on startup.
Some things that may be outstanding for consideration or comment:
- Cached versions of old dlls causing - how to find/remove them to ensure there is not some conflict 9even though the probe file should point the CLR to the right location?
- Use of the GAC? But if all DLLs are loaded assume this is not required? GAC also breaks ability to run a the No Admin installer
- Shim issues - if the DLLs are being loaded and the first line of code is not executing, could it be something in between like Shim?
- Any other suggestions related to an addin working on VSTO and then changing to Netoffice that I need to take into account?
Any assistance or pointers appreciated.
Comments: ** Comment from web user: ekirk0 **
Maybe there is an issue with the com that isn't apparent. Make a simple vb/js script that loads your com object by name. Then execute a function of that com object. This will help you determine if this is either com object references messed up or something else. Make a version property to return some info.
```
var type = System.Type.GetTypeFromProgID("name of com class");
var obj = Activator.CreateInstance(type);
obj.Version
```
have you thought about using wix to build your msi also. vsto has its limitations especially if you have to bust out orca to change things.