problem with deploying VSTO applications

Hi,
  finally we have got a web page reporting a complete procedure for preparing End User computers to run Office Solutions. It's here:
http://msdn2.microsoft.com/library/2ac08ee2(en-us,vs.80).aspx

  I had a problem when deploying my Excel project(made with VSTO in Visual Studio 2005 beta 2). I had installed .Net Framework 2.0 on the target machine, a PC with Excel 2003 installed. I had installed on the target machine the primary interop assemblies. I had copied the debug folder on the target machine. I had also run with success the CASPOL (with caspol 2.0 of the framework 2.0)procedure. When I opened the .xls document, I got the message that ' the assembly named "*" cannot be found or cannot be loaded '. Moreover, on my Excel worksheet there were buttons and textboxes, but they where totally non-interactive(no click on the buttons, no caret in the text box).

  I reported this as a bug and they finally released the complete procedure webpage. I was missing to install the VSTO runtime, with the program vstor.exe.  I found it on the Visual Studio 2005 beta 2 dvd. I launched it. Now the sheet opens correctly, and the buttons and the text boxes are interactive(I can click the buttons and the caret appears in the text box). I'm sorry, but I have one (hope!) final small problem, I think perhaps due to Primary interoperability Assemblies version: when I click on any of the buttons (whose click is handled in an internal method of the worksheet), I get the message:

"Old format or invalid type library (Exception from HRESULT: 0x80028018(TYPE_E_INVDATAREAD))"

The method isn't executed, and if I click again I get the same message.

Perhaps a newer version of the Primary Interop Assemblies is required (I got them from the original Visual Studio 2003 installation files, of many many months ago).

What's the next thing I'm supposed to do to make it work

I've already made a lot of steps with this procedure, thanks to Microsoft Assistance, let's hope we're near the end !



Answer this question

problem with deploying VSTO applications

  • Derek Comingore

    Cool! I think I've got it figured out. Using the deployment project in 2K5 just feel like a total hack to do anything. I can't wait for InstallShield to start supporting 2K5.

    I included the VSTO 2K5 install and Framework 2.0 SDK along with my install. I've got two custom actions setup to execute the VSTO and SDK installs before the install. I've got another custom action setup on the commit to execute a batch file which registers my addin.

    example:

    %systemroot%\MIcrosoft.NET\framework\v2.0.50215\caspol.exe -pp off
    %systemroot%\MIcrosoft.NET\framework\v2.0.50215\caspol.exe -m -ag All_Code -Url "%1\*" FullTrust -Name "%2"
    %systemroot%\MIcrosoft.NET\framework\v2.0.50215\caspol.exe -pp on

    Eample command line parameters for the batch file:

    "[TARGETDIR]\TestME.dll" "Test from Setup"

  • fixmycomputer

    Thanks for the assist Crillion. My first problem was that I didn't have the Framework 2.0 SDK on the target machine.

    I still haven't figured out how to get the .dot file to work right though. For some reason it keeps popping up a message box stating it cannot find the DLL. Is your install path the same as your development machine

  • RubenzTC

    Hi SideByEach,

      I don't know what is your .dot file's format, is it perhaps a document template from Word Anyway I've finally been able to make work my excel project. The installation path is not the same, but that doesn't matter. I simply copy the Debug folder of the project into the target machine, and then from there I open the .xls document from Windows Explorer. The .xls document and the dlls are all in the same Debug folder.

      They finally made a complete list of the steps that you must take(and I HAD to take them all) to make your project run. You can find it here:
    http://msdn2.microsoft.com/library/2ac08ee2(en-us,vs.80).aspx

      In particular, if it states that it can't find the assembly named "*" (I had also this problem), look always into that list of steps, at the point where you have to install on the target machine the VSTO office runtime (but note that before you MUST have already installed ALL the office "primary interop assemblies", NOT ONLY for word, but also for excel, office, tools for office - they are all subtrees of the Office installation set - these assemblies are on the Office 2003 Installation disc, you'll get them from control panel/add-remove programs/Office--> modify installation with the installation disc in the pc). You'll find instead the VSTO runtime installation program as vstor.exe on the Visual Studio 2005 Beta 2 Installation disc(do a search on the dvd, we did so 'cause we didn't know the exact path).

  • pieaholicx

    A couple of questions for you.

    1). How did you get access to the .Net command console on the target machine I've install the framework 2.0 on my target machine, but I don't have the console or the security entries in the control panel.

    2). what are you using to deploy your app

  • Dave Rogers

    It sounds like your Excel project is deployed to a computer that has Windows regional settings set to something other than English (United States). That causes the error message you see.

    Have a look at this article for information about the problem and the current workaround:
    http://msdn.microsoft.com/library/en-us/odc_vsto2005_ta/html/OfficeVSTOGlobalization.asp frame=true&_r=1

    Cheers,
    Harry Miller

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


  • AlanRR

    Hi,

     on the target machine I don't go to the .Net command console; I open the normal windows console (Start/Run -> "cmd").

      Then I go the folder

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215

    and there I launch the following bat:

    D:\PEWay\MyALM\Configurator\Debug\policy.bat

    that contains the commands to grant full trust to the project's assemblies:



    caspol.exe -polchgprompt off -u -addgroup All_Code -url "D:\PEWay\MyALM\Configurator\Debug\MyALMDbConfigurator.dll" FullTrust -name "MyALM Configurator Assembly"

    caspol.exe -polchgprompt off -u -addgroup All_Code -url "D:\PEWay\MyALM\configurator\Debug\PEWay.dll" FullTrust -name "MyALM Configurator Assembly"

    caspol.exe -polchgprompt on

    Pause



    There's a CASPOL invocation for each dll of the project, plus one to restore I don't know what aspect of the console prompt.

    To deploy my app, I simply copy the Debug folder of the project(which also contains a copy of the original .xls document) and brutally copy it on the target machine, at the path D:\PEWay\MyALM\...

    Note that
    1) I copy the debug folder,
    2) I place into it the policy.bat file,
    3) then I launch the policy.bat file.
    4) At this point I can open the .xls file, and it works(with buttons and textboxes enabled and reacting, but not event-handled) apart from my original problem. I have some kind of version compatibility problem that prevents the dlls from executing, as I reported above.

  • problem with deploying VSTO applications