tell user why add-in did not start (missing PIA)

D

David Thielen

Hi;

If the Office 2003 PIAs are missing, my .NET add-in will not start (which
makes sense). How can I pop up a message box in this case to tell the user
why they are not starting?
 
F

Fredrik Wahlgren

David Thielen said:
Hi;

If the Office 2003 PIAs are missing, my .NET add-in will not start (which
makes sense). How can I pop up a message box in this case to tell the user
why they are not starting?

Dave,
Good question. There's a similar problem here. What happens if only the XP
PIA's are present? I haven't done this so I would like to know.

/ fredrik
 
D

David Thielen

Hi;

My understanding on the XP PIAs is you are supposed to include them in your
installer and put them in the GAC if not there already. So that solves that
case.

But for Word 2003, you are not supposed to have the PIAs in your installer...

thanks - dave
 
P

Peter Huang

Hi

I think you may try to take a look at the AppDomain.AssemblyResolve Event
which occurs when the resolution of an assembly fails.
public Connect()
{
AppDomain cAppDm = AppDomain.CurrentDomain;
cAppDm.AssemblyResolve+=new ResolveEventHandler(cAppDm_AssemblyResolve);
}

private Assembly cAppDm_AssemblyResolve(object sender, ResolveEventArgs
args)
{
System.Diagnostics.Debug.WriteLine("Hello"+args.Name.ToString());
Assembly ass = Assembly.LoadFrom(@"C:\TestClass.dll");
return ass;
}

In normal loading process, the AssemblyResolve will not be called only when
the CLR try to load certain assembly including the PIA failed it will fire
the Event, if we provide the assembly here, the loading process will
continue, else it will not continue and we will get the error load addin.

I think you may try to show the dialog in the AssemblyResolve event handler
function.

If you still have any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
D

David Thielen

Hi;

Tried this - no luck:

1) When I do have the PIAs, I get a resolve event for AutoTag.resources (my
add-in is AutoTag.dll) whenever I bring up a dialog. Yet the resources in the
dialog show up fine.

2) The add-in never starts and this event is never triggered if
Microsoft.Office.Interop.Word.dll is missing on the computer. So somehow the
shim or mscoree.dll never even start to load my dll if the PIAs are not there.

3) Also, I also need a way for other problems when the shim won't load my
dll - such as it can't find it, it's not strongly named, no match in the
registry for the CLSID, etc.

Any other ideas? I'd really like to make this robust because when my add-in
won't load on a user's computer, I have zero information with which to figure
out the problem.

thanks - dave
 
P

Peter Huang

Hi,

If you have any more concerns on it, please feel free to post here.


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
D

David Thielen

Hi;

Tried this - no luck:

1) When I do have the PIAs, I get a resolve event for AutoTag.resources (my
add-in is AutoTag.dll) whenever I bring up a dialog. Yet the resources in the
dialog show up fine.

2) The add-in never starts and this event is never triggered if
Microsoft.Office.Interop.Word.dll is missing on the computer. So somehow the
shim or mscoree.dll never even start to load my dll if the PIAs are not there.

3) Also, I also need a way for other problems when the shim won't load my
dll - such as it can't find it, it's not strongly named, no match in the
registry for the CLSID, etc.

Any other ideas? I'd really like to make this robust because when my add-in
won't load on a user's computer, I have zero information with which to figure
out the problem.

thanks - dave
 
P

Peter Huang

Hi

I will research the issue and give you a reply ASAP.
Also based on my research, for shim, which is a ATL project, if you look
into it you will find it will create a new appdomain to load the managed
assembly.
I think you may try to add more code in the shim project to do your
additional checking.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang

Hi

Since in the process of loading an addin, the winword.exe will control the
main process, and we can not change/add/remove the code in the winword.exe.
So far what we can do is just add some messagebox(or log into a file) in
our own code.

e.g. In the Shim/Addin code which is an ATL project we can add the trace
log in every function to know which call is failed.

Also I think it would be better to write a FAQ readme for your end-user
which will help to troubleshooting.

Hope this helps.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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