C# AddIn takes a loooooong time to come up the first time

D

David Thielen

Hi;

We have an AddIn in C# (IExtensibility) and the main dialog in it takes a
long time to come up the first time. I've run it under the profiler and it's
not our code. Any idea as to what it can be?

Bringing up the AddIn does cause 8 DLLs to be loaded, some C#, some J#. The
are all strongly named and signed.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
W

Wei Lu [MSFT]

Hello Dave,

It makes sense that when the Word load the addin, it will load the .Net
framework which will takes some time.

There are really few things we could do to improve it.

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
D

David Thielen

Hi;

I don't think it's the .NET framework because this is after our
initialization code (in C#) has added us to the Word menu, etc. It happens
the first time we have to create and show our form.

When this happens it is the first time 8 DLLs we have are loaded. Is there a
way to speed up that load process (assuming that is what it is)? All of those
DLLs are strong named and signed.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
W

Wei Lu [MSFT]

Hello Dave,

Since you are using the C# add-in, it will load the .NET framework and this
will cause the performance.

I would like to know whether the 8 DLL is managed or unmanaged.

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jialiang Ge [MSFT]

Hello Dave

Wei is out of office these day and I will help him to handle this post.
Please let me know the information below so that I can provide further
assistance on this problem.

1. Do you have access to the codes of the 12 managed dlls? If that, would
you have a test on each of them separately to see whose loading process
caused the problem? Will it be the problem of the dlls themselves.
2. Would you add some signals, such as MsgBox "Dll 1 loading" or
MessageBox.Show("Dll 1 loaded"), to trace the process of loading and see
when the problem occurs.

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
D

David Thielen

Yes we have all 12. But none are loaded. I have used fusion and it never
loads anything - not even our shim. It does not even list our AddIn as an
AddIn in Word.

How can we find out why Word will not load an AddIn even when we have all of
the registry settings set correctly. I know the settings are correct because
we checked them and they are set by an install program that works on
thousands of other computers - just not this one.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
J

Jialiang Ge [MSFT]

Hi, Dave

I notice that you have posted a very similar question "Debug loggin from
Word?"
(http://msdn.microsoft.com/newsgroups/managed/default.aspx?dg=microsoft.publ
ic.office.developer.com.add_ins&mid=980f5daf-48fd-41ae-862c-feff1878602a&slo
c=en-us) in this newsgroup, which I have already responded. Please check my
reply their and if you need any further assistance on this particular
issue, please reply to me in that thread so I can follow up with you in
time.

For your convenience, I have included my reply as follows:

Thank you and have a nice day!

Hello Dave,

Here are another 2 suggestions you may try to find why your Word is not
loading the COM addins.

1. Use Process Monitor
(http://www.microsoft.com/technet/sysinternals/utilities/processmonitor.mspx
) to trace the load of the COM addins.
After you download and open the Process Monitor, set the 'Filter' (Ctrl+L)
as 'Process Name is winword.exe'. When you open your word, the process
monitor will list all the actions in registry, file system and thread. Find
the actions related to your COM addin (Ctrl+F) and check whether they are
loaded successfully in the 'RESULT' column. You may also refer to the
following blog page to get 'How to troubleshoot the COM Add-ins loading
issues'.
http://blogs.msdn.com/msdnts/archive/2006/12/28/how-to-troubleshoot-the-com-
add-ins-loading-issues.aspx

2. Have a try to load other official COM addins in your word application to
see whether there is anything wrong with your Word itself, because you said
the addin works fine in other machines.

For your question, so far, word itself did not expose any information to us
why it is not loading an addin subjectively.
Hope it helps

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
T

Tiberiu Molnar

Try to disable in Internet Explorer -> Options -> Advanced -> Security ->
'Check for publisher's certificate revocation' check box .

It worked on my case.
 
J

Jialiang Ge [MSFT]

Hello Tiberiu,
Many thanks to you for the suggestion which helps us find the cause of the
problem.

Hello Dave,

Microsoft Office uses some of the security settings set by Microsoft
Internet Explorer when it attempts to authenticate certificates of trust
prior to use, even if the certificate is already accepted and present on a
user's computer. Each time an Office application attempts to run an
executable signed with an attached certificate, some events occurs if the
Check for publisher's certificate revocation check box is set to checked in
the Internet Explorer Advanced settings dialog (See
http://office.microsoft.com/en-us/ork2003/HA011403081033.aspx).

The issue arises because the .NET Common Language Runtime (CLR) uses the
Public Key Infrastructure (PKI) system found on Windows systems and on an
isolated network. When .net framework is verifying a digitally signed
assembly, it requires downloading the CRL (certificate revocation list)
from the Certificate provider. The certificate checking mechanism times out
after a certain number of attempts to servers that host the CRL. The .NET
CLR loads the assembly after all the re-tries are completed, which shows up
as a 15 seconds delay. That is why it takes a long time to load your office
add-in. This behavior is by design.

This problem would occur with any .NET assemblies that are code signed
(http://msdn2.microsoft.com/en-us/library/ms537361.aspx) with a digital
certificate. A code-signed assembly is different from a strong-named one
(see http://conferences.codegear.com/cn/article/32226 ) . Code signing
assemblies is recommend because it makes components tamper-proof and
ensures users know the identity of the component publisher. Therefore we do
not suggest that you remove the code sign of your dlls.

The workarounds include:
1. uncheck the "Check for publisher's certificate revocation" in IE. By
disabling the CRL checking, you are not exposed to a security threat.
2. You could manually download the CRL and install in on the system. But
the CRL is valid only for 10-15 days.
3. it is possible to programmatically set the CRL verification. When the
'Check for publisher's certificate revocation' is unchecked, a setting in
the registry is changed. To turn off CRL verification, set
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\WinTrust\Trust
Providers\Software Publishing\State from 0x00023c00 to 0x00023e00. To turn
CRL Checking on again, reset the State key to 0x00023c00

Please let me know if you have any other concerns, or need anything else.

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
D

David Thielen

Hi;

I don't want to change the CRL setting on user's computers because I think
it is wrong for an install program to change a user's security settings and I
think the security admins would not allow our program at some companies if we
did that.

So I think our answer is to not sign our code (we will of course still
strongly name it).

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top