Acces denied on office assembly

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

Acces denied on office assembly
 
Sylvain Piron




Posts: 24
Joined: 2013-02-26
Hi,

One of my customer get this error when my addin try to install.
Could you help me with it?


Registrator version: 9.1.4620.0
Operating System: Microsoft Windows 10 Professional (build 17763), 64-bit
Process Owner: Administrator
Run 'As Administrator': No
Process Elevated: No
Integrity Level: Medium
UAC (User Account Control): On
...
15:53:56 0660 Assembly identity is 'AddinExpress.MSO.2005'.
15:53:56 0660 Success.
15:53:56 0660 Unwrapping the instance of the 'AddinExpress.Deployment.ADXRegistrator' class.
15:53:56 0660 Success.
15:53:56 0660 Calling the managed registration procedure (DISPID = 1610743823).
15:53:57 0660 Managed Error: 
(Inner Exception)
Date and Time:         29/04/2019 15:53:57
Machine Name:          xx
IP Address:            xx
Current User:          XXPC68

Application Domain:    C:UsersPC68AppDataRoamingMicrosoftAddInsAddinAddin
Assembly Codebase:     file:///C:/Users/PC68/AppData/Roaming/Microsoft/AddIns/Addin/Addin/AddinExpress.MSO.2005.DLL
Assembly Full Name:    AddinExpress.MSO.2005, Version=9.1.4620.0, Culture=neutral, PublicKeyToken=4416dd98f0861965
Assembly Version:      9.1.4620.0

Exception Source:      
Exception Type:        System.IO.FileLoadException
Exception Message:     Could not load file or assembly 'office, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. Accès refusé.

---- Stack Trace ----



(Outer Exception)
Date and Time:         29/04/2019 15:53:57
Machine Name:          CS007764
IP Address:            xx
Current User:          xx

Application Domain:    C:UsersPC68AppDataRoamingMicrosoftAddInsAddinAddin
Assembly Codebase:     file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
Assembly Full Name:    mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Assembly Version:      4.0.0.0

Exception Source:      mscorlib
Exception Type:        System.IO.FileLoadException
Exception Message:     Could not load file or assembly 'office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. Accès refusé.
Exception Target Site: GetExportedTypes

---- Stack Trace ----
   System.Reflection.RuntimeAssembly.GetExportedTypes(assembly As RuntimeAssembly, retTypes As ObjectHandleOnStack)
       mscorlib.dll: N 00000 (0x0) JIT 
   System.Reflection.RuntimeAssembly.GetExportedTypes()
       mscorlib.dll: N 0000 (0x0) IL 
   AddinExpress.Projects.Common.Utilities.GetRegistrableTypesInAssembly(assembly As Assembly)
       mscorlib.dll: N 0006 (0x6) IL 
   AddinExpress.Projects.Common.Utilities.RegisterAssembly(assembly As Assembly, createVersionKey As Boolean, allUsers As Boolean, targetHive As ADXTargetRegistryHive, callRegMethod As Boolean)
       mscorlib.dll: N 0000 (0x0) IL 
   AddinExpress.Deployment.AddinDomainAdapter.RegisterForComInterop(register As Boolean, dllType As String, dllPath As String, showExceptions As Boolean)
       mscorlib.dll: N 0205 (0xCD) IL 
   AddinExpress.Deployment.ADXRegistrator.RegisterAssembly(commandLine As String)
       mscorlib.dll: N 0696 (0x2B8) IL 



15:53:57 0660 The add-in registration process is completed with HRESULT = -2147467259.


Thanks.

Best regards

Sylvain
Posted 29 Apr, 2019 09:22:51 Top
Andrei Smolin


Add-in Express team


Posts: 17110
Joined: 2006-05-11
Hello Sylvain,

Please make sure you deploy all the interop assemblies used in your add-in project.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 29 Apr, 2019 09:43:20 Top
Bargholz Thomas




Posts: 242
Joined: 2006-12-18
Hi Sylvain,
I am facing the same issue as you. The issue occurs on PC's that used to work perfectly, even with out any updates to my add-in. It started occuring on a few machines a couple of weeks ago.
This is what I have found out from what is happening for my add-in:

The issue occurs under these conditions:

1. The add-in is installed with elevanted priviliges (administrator), so that one installation on the PC installs for all users
2. My Office installation is from Office 365 (it does not seem to happen with standard Office Professional 2016 installations - have not tested Office 2019 yet)

When the add-in is first installed, it works perfectly. After a (short, for instance a day) period of time, it will throw an error when the add-in loads, with some of the core components missing.
I can get it to work with one of these methods:

1. If I uninstall and then install again it works.
2. If I repair my Office 365 installation it works.

But after a (again short) period of time, it will fail once more.

I have also found, that if I run my Office app as administrator, the add-in works perfectly at all times.

So to me it looks as if there has been some update to Office 365 and how it relates to priviliges, but eatly what is happningen I do not know.
I will try creating a MSI package that runs in user mode, to see if that changes anything, but have not have had time to do so yet.

Regards
Thomas
Posted 29 Apr, 2019 10:51:30 Top
Andrei Smolin


Add-in Express team


Posts: 17110
Joined: 2006-05-11
Hello Thomas,

Bargholz Thomas writes:
I am facing the same issue as you.


Do you deploy that interop assembly?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 30 Apr, 2019 03:00:10 Top
Sylvain Piron




Posts: 24
Joined: 2013-02-26
Hi Andrei, Hi Thomas,

Thanks for your answers. I do ship the assemblies with my addin. It does work for all my others customers in many differents configurations.

I will try to ask my customer to repair his office and see if the problem goes away.

Best regards
Sylvain.
Posted 30 Apr, 2019 03:53:23 Top
Andrei Smolin


Add-in Express team


Posts: 17110
Joined: 2006-05-11
Hello Sylvain and Thomas,

This issue may relate to Office being updated right in this moment. We suggest that you 1) use embedded interops (in this case you don't need to deploy the interop assemblies) and 2) run the .NET Framework Repair Tool on that machine.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 01 May, 2019 03:38:32 Top