AddinExpress.MAPI.dll missing dependencies : CLR Issue?

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

AddinExpress.MAPI.dll missing dependencies : CLR Issue?
Using MAPI Store Accessor 
Tony Gravagno


Guest


My development has a working Addin:
Win7/32 + Outlook 2010 + VS2010 + .NET4

I created a setup and attempt to deploy to XP/32 + Outlook 2010
.NET4 is on the target system.
I'm executing setup.exe and not the MSI, with dependencies for Windows Installer 4.5 and NET 4.0.

The install log shows AddinExpress.MAPI.dll or one if its dependencies is missing.

I changed my Custom Actions arguments for Install of adxregistrator.exe to:

/install="my.dll" /privileges=user /CLRVersion=2.0

This seems to force the entire install/registration process to .NET2, even though my assembly is .NET4.

With very little information available on this, and yes I believe I have read all of the other forum postings on this topic as well as the pages they link to, I added the following to my project's App.Config:

<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
  </startup>
</configuration>


I added that to the primary output and the file is in the deployed directory, but I'm almost certain this is the wrong solution.

So in short, I'm building with .NET4, using the MAPI Store Accessor which I believe was built with .NET2, the .NET versions are on the target system, but adxregistrator is failing. Any ideas? Thanks!
Posted 13 May, 2012 03:43:20 Top
Tony Gravagno


Guest


Follow-up ...

I removed the CLRVersion=2.0. I really thought this this was going to be the solution, note that I'm using ADX 6.6.3059. My log looks almost exactly like that of someone else posting here and CLRVersion=2.0 was their solution.

So I checked dependencies:
.NET 1.1 is there for Office.dll.
I wasn't sure if we need Visual C++ Redistributable SP1, but the system does have C++ 2008. I'm wondering if I should add a prereq for C++ 2010. Doubt it.
I checked all of the files on the target system. All dependencies seem to be there.

I'm also using the Teleric WinControls which look like they're built with .NET2 from the assembly Version property. .NET2 is installed.

Log follows in my next reply. For some reason this forum rejects the log saying "Message Text" but no specific error about the message text.
Posted 13 May, 2012 17:21:18 Top
Tony Gravagno


Guest


14:25:51 0124 Unwrapping the instance of the 'AddinExpress.Deployment.ADXRegistrator' class.
14:25:51 0124 Success.
14:25:51 0124 Calling the managed registration procedure.
14:25:51 0460 Connecting to the application domain of the Add-in Express loader.
14:25:51 0460 Success.
14:25:51 0460 Loading the 'myassembly.dll' assembly.
14:25:51 0460 Success.
14:25:51 0460 Registering the 'myassembly.dll' assembly (user).
14:25:51 0124 Managed Error: 
(Inner Exception)
(Inner Exception)
Date and Time:         5/13/2012 2:25:51 PM
Machine Name:          HOST
IP Address:            192.168.1.211
Current User:          HOSTuser

Application Domain:    C:Documents and SettingsuserApplication Datacompanyproduct
Assembly Codebase:     file:///C:/Documents and Settings/user/Application Data/company/product/AddinExpress.MSO.2005.DLL
Assembly Full Name:    AddinExpress.MSO.2005, Version=6.6.3059.2005, Culture=neutral, PublicKeyToken=4416dd98f0861965
Assembly Version:      6.6.3059.2005

Exception Source:      myassembly
Exception Type:        System.IO.FileNotFoundException
Exception Message:     Could not load file or assembly 'AddinExpress.MAPI.dll' or one of its dependencies. The specified module could not be found.
Exception Target Site: InitializeComponent

---- Stack Trace ----
   EmailRuleAddin.AddinModule.InitializeComponent()
       AddinExpress.MSO.2005.DLL: N 00000 (0x0) JIT 
   EmailRuleAddin.AddinModule..ctor()
       AddinExpress.MSO.2005.DLL: N 0022 (0x16) IL 



(Outer Exception)
Date and Time:         5/13/2012 2:25:51 PM
Machine Name:          HOST
IP Address:            192.168.1.211
Current User:          HOSTuser

Application Domain:    C:Documents and SettingsuserApplication Datacompanyproduct
Assembly Codebase:     file:///C:/Documents and Settings/user/Application Data/company/product/AddinExpress.MSO.2005.DLL
Assembly Full Name:    AddinExpress.MSO.2005, Version=6.6.3059.2005, Culture=neutral, PublicKeyToken=4416dd98f0861965
Assembly Version:      6.6.3059.2005

Exception Source:      mscorlib
Exception Type:        System.Reflection.TargetInvocationException
Exception Message:     Exception has been thrown by the target of an invocation.
Exception Target Site: CreateInstance

---- Stack Trace ----
   System.RuntimeTypeHandle.CreateInstance(type As RuntimeType, publicOnly As Boolean, noCheck As Boolean, canBeCached As Boolean&, ctor As RuntimeMethodHandleInternal&, bNeedSecurityCheck As Boolean&)
       AddinExpress.MSO.2005.DLL: N 00000 (0x0) JIT 
   System.RuntimeType.CreateInstanceSlow(publicOnly As Boolean, skipCheckThis As Boolean, fillCache As Boolean)
       AddinExpress.MSO.2005.DLL: N 0028 (0x1C) IL 
   System.RuntimeType.CreateInstanceDefaultCtor(publicOnly As Boolean, skipVisibilityChecks As Boolean, skipCheckThis As Boolean, fillCache As Boolean)
       AddinExpress.MSO.2005.DLL: N 0165 (0xA5) IL 
   System.Activator.CreateInstance(type As Type, nonPublic As Boolean)
       AddinExpress.MSO.2005.DLL: N 0056 (0x38) IL 
   AddinExpress.MSO.ADXAddinModule.ADXRegister(t As Type)
       AddinExpress.MSO.2005.DLL: N 0598 (0x256) IL 
   EmailRuleAddin.AddinModule.AddinRegister(t As Type)
       AddinExpress.MSO.2005.DLL: N 0000 (0x0) IL 



(Outer Exception)
Date and Time:         5/13/2012 2:25:51 PM
Machine Name:          HOST
IP Address:            192.168.1.211
Current User:          HOSTuser

Application Domain:    C:Documents and SettingsuserApplication Datacompanyproduct
Assembly Codebase:     file:///C:/Documents and Settings/user/Application Data/company/product/AddinExpress.MSO.2005.DLL
Assembly Full Name:    AddinExpress.MSO.2005, Version=6.6.3059.2005, Culture=neutral, PublicKeyToken=4416dd98f0861965
Assembly Version:      6.6.3059.2005

Exception Source:      mscorlib
Exception Type:        System.Reflection.TargetInvocationException
Exception Message:     Exception has been thrown by the target of an invocation.
Exception Target Site: _InvokeMethodFast

---- Stack Trace ----
   System.RuntimeMethodHandle._InvokeMethodFast(method As IRuntimeMethodInfo, target As Object, arguments As Object[], sig As SignatureStruct&, methodAttributes As MethodAttributes, typeOwner As RuntimeType)
       AddinExpress.MSO.2005.DLL: N 00000 (0x0) JIT 
   System.RuntimeMethodHandle.InvokeMethodFast(method As IRuntimeMethodInfo, target As Object, arguments As Object[], sig As Signature, methodAttributes As MethodAttributes, typeOwner As RuntimeType)
       AddinExpress.MSO.2005.DLL: N 0007 (0x7) IL 
   System.Reflection.RuntimeMethodInfo.Invoke(obj As Object, invokeAttr As BindingFlags, binder As Binder, parameters As Object[], culture As CultureInfo, skipVisibilityChecks As Boolean)
       AddinExpress.MSO.2005.DLL: N 0167 (0xA7) IL 
   System.Reflection.RuntimeMethodInfo.Invoke(obj As Object, invokeAttr As BindingFlags, binder As Binder, parameters As Object[], culture As CultureInfo)
       AddinExpress.MSO.2005.DLL: N 0000 (0x0) IL 
   AddinExpress.Projects.Common.Utilities.CallUserDefinedRegistrationMethod(type As Type, bRegister As Boolean, targetHive As ADXTargetRegistryHive)
       AddinExpress.MSO.2005.DLL: N 0337 (0x151) IL 
   AddinExpress.Projects.Common.Utilities.RegisterType(t As Type, createVersionKey As Boolean, allUsers As Boolean, targetHive As ADXTargetRegistryHive, callRegMethod As Boolean)
       AddinExpress.MSO.2005.DLL: N 0247 (0xF7) IL 
   AddinExpress.Projects.Common.Utilities.RegisterAssembly(assembly As Assembly, createVersionKey As Boolean, allUsers As Boolean, targetHive As ADXTargetRegistryHive, callRegMethod As Boolean)
       AddinExpress.MSO.2005.DLL: N 0040 (0x28) IL 
   AddinExpress.Deployment.AddinDomainAdapter.RegisterForComInterop(register As Boolean, dllType As String, dllPath As String, showExceptions As Boolean, logFullPath As String)
       AddinExpress.MSO.2005.DLL: N 0228 (0xE4) IL 
   AddinExpress.Deployment.ADXRegistrator.RegisterAssembly(commandLine As String)
       AddinExpress.MSO.2005.DLL: N 0437 (0x1B5) IL

14:25:51 0124 The add-in registration process is completed with HRESULT = -2147467259.
Posted 13 May, 2012 17:22:09 Top
Tony Gravagno


Guest


Final note for the day. :)

One thing I did not do was to put the App.config in the path of Outlook 2010. That seems to be what's suggested in this other thread:
http://www.add-in-express.com/forum/read.php?FID=5&TID=8420

The problem there is that we either need to manually put that config on a target system, or create a separate installer to put it there, or add special code into the ADX-enabled setup to get it there. This seems to be a bit "rigorous". These solutions are not practical for a product that will targeted unknown user systems.

As you can see, I'm trying... I'll work on another project until there is some feedback on this.

Thanks as always.
Posted 13 May, 2012 19:39:42 Top
Eugene Astafiev


Guest


Hi Tony,

Of course, you need to include the http://www.microsoft.com/en-us/download/details.aspx?id=5582 to the list of prerequisites of your installer. The only possible solution in this case is to create a config file (or modify the existing one) for the host application (Outlook in your case). Name it Outlook.exe.config and place it in the same folder where Outlook.exe resides. Typically, for Outlook 2007, it is the C:\Program Files\Microsoft Office\Office12 folder. Please use the following content for the config file:

<?xml version="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration> 


Anyway, I have just e-mailed a new build of the AddinExpress.MAPI.dll assembly to you (it is built against .net 4.0). Please check out your Inbox.
Posted 14 May, 2012 04:08:11 Top
Tony Gravagno


Guest


Eugene, you are awesome! :)

It looks like you copy/pasted part of your reply from the post that I linked to. I just want to make sure we're both clear on the detail here:

1) If I use the new .NET4 MAPI assembly, I should not need the special config section, right? (At least for the ADX controls.)

2) Given that this is 2012, should I add a prereq for C++ 2010, or C++ 2008?

3) Given that ADX addins with Outlook are so common, did I miss documentation that says "you must always create a config file and set C++2008 as a prereq when deploying ADX/MAPI" ? I've been through the forum and blogs many times now (always learning) and it seems like this is the exception rather than the rule. How is that possible? I'm just trying to understand the rule of when we need these components and when not.

4) I understand that it's not built in to the product, but does anyone have code laying around that finds the location of Outlook.exe to create a config file before the registration process begins? I don't want anyone to write this now - per #1 we may not need it. But I'm thinking this code must to be out there somewhere.

OK, I'll work on the .NET4 assembly and report back here in the next 24 hours.

Thanks!
Posted 14 May, 2012 10:10:01 Top
Eugene Astafiev


Guest


Hi Tony,

Yes, I have copied a part of my reply from another thread to make the things clearer.

1. No, you don't need to do any preparations if you use .net 4 based assembly.
2. You are on the right avenue. If you use .net 4.0 based assembly you need to choose the C++ 2010 SP1 prerequisite.
3. The AddinExpress.MAPI.dll is a mixed mode assembly which is build against .net 2.0 framework. That is why you need to do additional preparations for .net 4.0. In case of .net 4.0 framework you just need to include the http://www.microsoft.com/en-us/download/details.aspx?id=8328. There is no need to modify the config file now.
4. No, there is no such code. Please try to look at the windows registry at the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE hive.
Posted 14 May, 2012 10:26:16 Top
Tony Gravagno


Guest


Eugene, the v4 assembly works, no config file or change to the Custom Actions required.

I also see from the http://www.add-in-express.com/products/mapi-store-events.php that the C++ redistributable is required - I missed that before.

That's it for this one, bud. This thread can be closed.

Thanks again!!
T
Posted 18 May, 2012 00:37:39 Top
Eugene Astafiev


Guest


Hi Tony,

Thank you for letting me know and good luck with your add-in project!
Posted 18 May, 2012 02:26:04 Top