Nitstheone

There are so many people having deplyment issues on end user machines (including me ), I am wondering if there is a troubleshooting utility, which would check if the environment is ok and generate a log.

My problem : Addin does not load in excel (LoadBehavior=2) on Virtual PC

VPC(2004sp1) is using Win xp SP2, office 2003 SP2, dot net 2.0,PIA, VSTOR and nothing else

I have developed an Addin using VSTO SE for Excel 2003, added setsecurity project.

I can deploy its setup on my as well as some dev machine, but when i try to deploy it on clean virtual PC, installation completes but the addin does not load. Excel states the error as "Not Loaded. A runtime error occured...". Now if I reopen excel, the addin behavior is "Load at Startup", but it is not loaded

C:\Program Files\Common Files\Microsoft Shared\VSTO\8.0\AddinLoader.dll version is 8.0.50727.42 ( can this be a problem, I have observed that some machines have other versions - .444 or .816)

I have also tried set VSTO_SUPPRESSDISPLAYALERTS=0, but no use.

I have added try{} catch(Exception ex){} in ThisAddin_Startup

I have also checked Excel -> Help->About->Disabled Items, nothing is disabled

Caspol.exe -u -lg gives following output( I have edit the company and addin name)

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>caspol -u -lg
Microsoft (R) .NET Framework CasPol 2.0.50727.42
Copyright (c) Microsoft Corporation.  All rights reserved.

Security is ON
Execution checking is ON
Policy change prompt is ON

Level = User

Code Groups:

1.  All code: FullTrust
   1.1.  Url - C:\Program Files\My Company\My Excel Plug
-in\*: Nothing
      1.1.1.  StrongName - 00240000048000009400000006020000002400005253413100040
0000100010063D4590B01A308CDA72DD242D73E80973850D9BE5788E7FCC70680FF29871D2AA42F2
942DD3739BF6C9E54E96E1F26441978D7BA9308805A7AB23008156A1C33CD484243BE36CDD1E214B
3A12FCA0089262685759088DAA222A57777F8038EC09CEDF01545BA3A64E1A550F6396BC972D865A
459001D7400A15E8791E8AE2EBB name = My Excel Plug-in version = 0.0.0.1: Fu
llTrust
Success

 Thanks for reading my problem, any help on my problem will be really appreciated.

- Nitin

Edit :

I got a log by set VSTO_LOGALERTS=1
Any idea whats going wrong

Log entry added at 2:54:38 PM:
-----------Caption----------------
Office document customization is not available
-----------Message----------------
An add-in could not be found or could not be loaded.
-----------Details----------------
Could not load type 'Microsoft.Office.Tools.AddIn' from assembly 'Microsoft.Office.Tools.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.


************** Exception Text **************
System.TypeLoadException: Could not load type 'Microsoft.Office.Tools.AddIn' from assembly 'Microsoft.Office.Tools.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
   at System.Reflection.Assembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
   at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.CreateStartupObject(EntryPoint entryPoint, Dependency dependency, Assembly objectAssembly)
   at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ConfigureAppDomain()
   at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.LoadAssembliesAndConfigureAppDomain(IHostServiceProvider serviceProvider)
   at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ExecuteCustomization(IHostServiceProvider serviceProvider)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Microsoft.VisualStudio.Tools.Applications.Runtime
    Assembly Version: 8.0.0.0
    Win32 Version: 8.0.50727.42
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Runtime/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Runtime.dll
----------------------------------------
Microsoft.Office.Tools.Common
    Assembly Version: 8.0.0.0
    Win32 Version: 8.0.50727.42
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.Office.Tools.Common/8.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.Common.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
My Excel Plug-in
    Assembly Version: 0.0.0.1
    Win32 Version: 0.0.0.1
    CodeBase: file:///C:/Program%20Files/Mycompany/MyPlug-in/MyExcel%20Plug-in.DLL
----------------------------------------


 



Re: Visual Studio Tools for Office Deploying VSTO SE addin : Is there a Debugging Utility available

Dennis Wallentin

Hi Nitin,

I can agree that deployment can be an difficult issue to solve. Let see if the following can resolve the issue You face:

Microsoft Visual Studio 2005 Tools for Microsoft Office System: Microsoft PSS VSTO 2005 Client TroubleShooter

Deploying Visual Studio 2005 Tools for Office Solutions Using Windows Installer: Walkthroughs (Part 2 of 2)
Check out the part 'The walkthrough for Outlook 2003 add-in.'

A good introduction to CAS:
Understanding .NET Code Access Security

If none of the above sources enable You to solve it then You may consider to install the following fix:
FIX: Add-ins, smart documents, or smart tags that you create by using Microsoft Visual Studio 2005 do not run in Office






Re: Visual Studio Tools for Office Deploying VSTO SE addin : Is there a Debugging Utility available

Nitstheone

Hi All :),

The problem is solved. And this is how it got solved. (kind of - i still need to figure out the root cause)

I was the getting the error:

Could not load type 'Microsoft.Office.Tools.AddIn' from assembly 'Microsoft.Office.Tools.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

I checked this assembly through ILDASM and guess what it did not have the type 'Microsoft.Office.Tools.AddIn'.

Now i checked the same assembly from the machine on the dev machine, and guess what it contained the type.

So basically, somehow my VPC had the wrong version of the DLL.

Wrong DLL's Assembly Version : 8.0.0.0, FileVersion : 8.0.50727.42

Working DLL's Assembly Version : 8.0.0.0, FileVersion : 8.0.50727.444

I replace the working DLL from dev machine and replaced it on the VPC, and the addin loaded.

I think anything above .444 should be fine, as I saw other machines that had .816 (I havent tested there).

Now the Question is , how did I end up with the wrong version of the DLL

Does the order of installation (Office, dot net, office sp2) have anything to do with this





Re: Visual Studio Tools for Office Deploying VSTO SE addin : Is there a Debugging Utility available

Nitstheone

YES !!! A debugging utility is available.

http://www.microsoft.com/downloads/details.aspx familyid=c9fb6a54-8069-4918-a6f9-e744928dfac3&displaylang=en

The Microsoft PSS VSTO 2005 Client TroubleShooter tool is an application designed to help diagnose potential client-side issues when you deploy a VSTO 2005 solution. The tool scans the client computer for the prerequisites required to run a VSTO 2005 solution and reports the state of the prerequisites in the form of an HTML report. The tool also provides links to information about how to resolve an issue when a prerequisite was not found on the client computer.

It gives you a pretty neat log of the environment. BTW what does PSS stand for

Can I redistribute it

I hope this thread helps others too :)

- Nitin





Re: Visual Studio Tools for Office Deploying VSTO SE addin : Is there a Debugging Utility available

Dennis Wallentin

Nitin,


YES !!! A debugging utility is available.

Wow! Did You manage to discover it Yourself or was it, by any chance, by reading any other comment in this thread






Re: Visual Studio Tools for Office Deploying VSTO SE addin : Is there a Debugging Utility available

McLean Schofield - MSFT

I might be able to answer your question about how your VPC wound up with a version of Microsoft.Office.Tools.Common.dll that does not contain the Microsoft.Office.Tools.AddIn class.

There are actually two different versions of the VSTO 2005 runtime that include Microsoft.Office.Tools.Common.dll. The first version of the runtime shipped in late 2005, as part of VSTO 2005. (This is the version of VSTO 2005 that included doc-level projects for Word 2003 and Excel 2003, and app-level projects for Outlook 2003). The version of Microsoft.Office.Tools.Common.dll in this version of the runtime does not include the Microsoft.Office.Tools.AddIn class. I assume that this is the version of the VSTO runtime on your VPC.

The second version of the VSTO 2005 runtime is the one that shipped with VSTO 2005 SE in late 2006. (This is the version of VSTO that included app-level projects for many Office 2003 and Office 2007 applications). This version introduced a new add-in programming model that utilizes the Microsoft.Office.Tools.AddIn class, and hence this class was added to the Microsoft.Office.Tools.Common.dll assembly in the VSTO 2005 SE runtime.

So, you must install the VSTO 2005 SE version of the runtime on any computer that you want to deploy VSTO 2005 SE add-ins to. Even if the deployment computer already has the first version of the VSTO 2005 runtime on it, you must still install the VSTO 2005 SE runtime in order for the new add-ins to work.

For more information, see http://msdn2.microsoft.com/en-us/library/ms178739(VS.80).aspx.

I hope this helps,

McLean Schofield






Re: Visual Studio Tools for Office Deploying VSTO SE addin : Is there a Debugging Utility available

Nitstheone

Thanks McLean for that info, it turned out that I was using vsto and not vsto SE

The versions are as follows :

.42 == VSTO

.444 == VSTO SE Beta

.816 == VSTO SE

Well now I have a new problem, I copied the correct vstor.exe in the directory ...\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vstor but now product.xml and package.xml is wrong . I get a warning which says :

Warning 3 The value of the 'PublicKey' attribute in 'Microsoft Visual Studio Tools for Office Runtime Redistributable' does not match that of file 'D:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bootstrapper\Packages\vstor\vstor.exe'.

Where can I get the correct product.xml and package.xml Any pointers Can I ignore the warning will it affect anything I am guessing, if user has vsto installed then my setup will think its ok and not install vsto SE -- am I right

Thanks,

Nitin





Re: Visual Studio Tools for Office Deploying VSTO SE addin : Is there a Debugging Utility available

Nitstheone

Looks like i should do a search in this forum before posting :P, I found the vsto SE public key at http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1039582&SiteID=1

So now my warning is gone. I also looked up ComponentID for vsto SE, and it turns out to be same as vsto. However someone did mention the following :

yes it is is, but there is also a new registry key

HKLM\Software\Microsoft\VSTO Runtime setup\v2.0.50727

Update=1

Does this mean that In my setup, I will have to set this registry key Any articles regarding how to do this correctly when using Visual Studio setup project

Thanks,

Nitin