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 !
[2184 byte] By [
crillion] at [2007-12-16]
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.50215and there I launch the following bat:
D:\PEWay\MyALM\Configurator\Debug\policy.batthat 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.
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).
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"