Error deploying VSTO Office addin - ms-office

I'm having some issues deploying a Visio addin.
Running the VSTO file works on my computer, but whenever I try and move it to any other user's computer it throws an error on deployment.
I thought it might be a setting I'd set in the project properties so I created an entirely new plugin project and set it to display a message box on startup.
The error I'm getting is:
An error occured during customization install.
The expected element "addIn" was not found in the XML.

This is caused by an issue with Clickonce.
I found a workaround by installing the addin using MSI.
This Guide was a lot of help.
Taken from the section about registry settings for the msi installation:
It is important to note the ‘|vstolocal’ value appended to the end of the Manifest value. This informs the VSTO runtime that it is locally installed and to not invoke the ClickOnce installer.

I'm having the same issue with our Word, Excel, Outlook and PowerPoint add-in. The installation of the msi runs perfect.
When starting Word for example, the Add-in itself gets 'installed' and then I receive the error.
I have added |vstolocal to the registry, which is located in the HKCU tree.
The projects is a Visual Studio 2010 project, build on TFS 2008. The installation on an Office 2010 goes well, the error only occurs when Office 2007 is on the machine.
Anything else I'm overseeing?

The solution to my experience with this issue was the one given by Joeri on the 8th July - install Visual Studio 2010 Tools for Office Runtime on the target machine.

This is an issue with the version of Visio your add-in targets versus what is installed on the client machine. AddIn is an element that is new with the 2007 versions of Office. More than likely the client is running Visio 2003.

Some times the Visual Studio 2010 Tools for Office Runtime is installed on the machine but the vsto file fails to find it. In this case try if you can manually execute the installation command line.See example below (replace X with your own drive letter, path, and file name):
"c:\Program Files\Common Files\Microsoft Shared\VSTO\10.0\VSTOInstaller.exe" /Install file:///X:/XXX/XXX.vsto 

Related

Deployment of Visual Studio Add-in in VS 2012

I have created Visual studio add-in successfully.But I am confused to deploy this addin in another computers.I have go throgh the stackoverflow answers.But I did not get clear cut idea about this matter
You just need to copy YourAddIn.dll and YourAddIn.AddIn files to "c:\Users\username\Documents\Visual Studio 2012\Addins\" folder on another computer. To create an installer you can start with Wix Template For VS2012 Addin Project.
Deploying an add-in requires to copy the add-in dll(s) to some folder and create a XML .AddIn file in a predefined folder where VS can locate it where a entry of the XML file points to the add-in assembly.
For articles about the prefedined folders for .AddIn files and about creating a setup see the "Articles about installing and uninstalling" section of my web site:
http://www.visualstudioextensibility.com/articles/add-ins/
To troubleshoot problems loading add-ins see my article:
HOWTO: Troubleshooting Visual Studio and Office add-ins
Visual Studio is a 32-bit executable, so the add-in dll and dependencies must be 32-bit.

VSTO - Unable to deploy an application

I am creating an Excel document level add-in in Visual Studio 2013 but am having trouble deploying it.
The application runs on my computer no problem. It also runs on another computer I have that has Visual Studio installed but when I try and install it on a computer that doesn't have Visual Studio installed I get the below error message.
I have been unable to find the exact route of the problem. I have tried unclicking the Sign ClickOnce Deployment check box but to no avail.
I also tried using InstallShield (similar security issues) but would prefer to use ClickOnce.
Thank you in advance.

Where are the Office PIA's installed?

I am writing an application in IIS that uses the Microsoft office excel automation library. I have downloaded the Office PIA from here and it downloaded an executable called PIARedist which I ran. This unpacked into 3 files o20120_eula.txt, o2012_readme.rtf and o2012pia which is a windows installer package. I ran the windows installer package, and that's where I got stuck, I expected it to unpack all of the libraries that I need, or put them somewhere in the file system, but nothing. The installer ran, but with no indication of what it was doing or what it was installing. Where do I go from here to obtain these libraries? And is developing on windows always this awful?
They live here:
C:\Program Files x86\Microsoft Visual Studio 14.0\Visual Studio Tools for Office\PIA
Where do I go from here to obtain these libraries?
They will have been installed in the GAC. After installing, you should be able to add a COM reference to Excel in Visual Studio, and it will reference the PIA assembly rather than generating an assembly with TLBIMP.
And applications that reference the PIA from that version of Office will be able to run.
And is developing on windows always this awful?
Not always, but more often than I'd like.
It turns out I just hadn't installed office on my machine. I assumed that it came preinstalled since there was an icon for it in the start menu, but that icon was what installed office.

The 'ProviderPackage' package did not load correctly

I installed Visual Studio 2012 and at a later date Update 2. After installing Update 2, when I load any project, I get the following error:
---------------------------
Microsoft Visual Studio
---------------------------
The 'ProviderPackage' package did not load correctly.
The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:\Users\username\AppData\Roaming\Microsoft\VisualStudio\11.0\ActivityLog.xml'.
Continue to show this error message?
---------------------------
Yes No
---------------------------
After locating the ActivityLog.xml, I see the following set of errors:
<entry>
<record>300</record>
<time>2013/04/23 18:32:54.002</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Begin package load [ProviderPackage]</description>
<guid>{5F2E5E42-4192-4D79-A0D8-1D881E808829}</guid>
</entry>
<entry>
<record>301</record>
<time>2013/04/23 18:32:54.012</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [ProviderPackage]</description>
<guid>{5F2E5E42-4192-4D79-A0D8-1D881E808829}</guid>
<hr>80131522</hr>
<errorinfo>Method 'GetHostedIntellisenseTypes' in type 'Microsoft.VisualStudio.Progression.DTEWrapperCached' from assembly 'Microsoft.VisualStudio.GraphProviderPackage, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' does not have an implementation.</errorinfo>
</entry>
<entry>
<record>302</record>
<time>2013/04/23 18:32:54.012</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package load [ProviderPackage]</description>
<guid>{5F2E5E42-4192-4D79-A0D8-1D881E808829}</guid>
<hr>80131522</hr>
<errorinfo>Method 'GetHostedIntellisenseTypes' in type 'Microsoft.VisualStudio.Progression.DTEWrapperCached' from assembly 'Microsoft.VisualStudio.GraphProviderPackage, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' does not have an implementation.</errorinfo>
Google searches do not reveal an exact match on my issue. I've tried searching the packages on the install ISO and cannot locate a package that needs to be repaired...
F:\packages>dir /s *provider*
Volume in drive F is VS2012_ULT_MSDN_ENU
Volume Serial Number is 4A21-C8BD
Directory of F:\packages\SSDT
07/26/2012 11:30 AM 780,288 DbSqlPackageProvider.msi
1 File(s) 780,288 bytes
Total Files Listed:
1 File(s) 780,288 bytes
0 Dir(s) 0 bytes free
Any other ideas?
Close Visual Studio.
Open a Developer Command Prompt for Visual Studio 2012 (as administrator).
Type devenv /setup.
Restart Visual Studio.
Possible duplicate of Visual Studio 2012 error: Package 'Visual C++ package' failed to load
See Visual C++ package: failed to load?????
This is Aaron's (Aaron Reed) answer from above, just copied as an answer instead of part of the question:
Fixed it... Fixed it... Fixed it...
Opened Programs and Features (run: appwiz.cpl)
Sorted list of installed apps by: Install Date
Filtered list by adding "SQL" to the upper right search filter
List item
I installed VS2012 on 4/1/13, so I went through each listed SQL item in the list, and right click --> Repair
From there I ran VS2012 and opened the target Solution file without issue.
My list:
Microsoft SQL Server 2012 Data-Tier App Framework
Microsoft SQL Server Data Tools - enu (11.1.20627.00)
Microsoft SQL Server 2012 Management Objects (x64)
Microsoft System CLR Types for SQL Server 2012 (x64)
Microsoft System CLR Types for SQL Server 2012
Microsoft SQL Server 2012 Management Objects
Microsoft SQL Server 2012 Transact-SQL Compiler Service
Microsoft SQL Server 2012 Command Line Utilities
Microsoft SQL Server Data Tools Build Utilities - enu (11.1.206...
Microsoft SQL Server Compact 4.0 SP1 x64 ENU
Microsoft SQL Server 2012 T-SQL Language Service
Microsoft SQL Server 2012 Native Client
Microsoft SQL Server 2012 Data-Tier App Framework
Microsoft SQL Server 2012 Express LocalDB
Microsoft SQL Server 2012 Transact-SQL SpriptDom
This worked for me -
In order to fix the issue one needs to clear the Visual Studio cache under:
%LOCALAPPDATA%\Microsoft\VisualStudio\11.0\ComponentModelCache
Thanks go to blog post SetSite failed for package [Microsoft.VisualStudio.Editor.Implementation.EditorPackage].
Usually this can be fixed by clearing the Visual Studio cache under:
Visual Studio 2012: %LOCALAPPDATA%\Microsoft\VisualStudio\11.0\ComponentModelCache
Visual Studio 2013: %LOCALAPPDATA%\Microsoft\VisualStudio\12.0\ComponentModelCache
I fixed this by uninstalling or removing:
Microsoft SQL Server Data Tools - enu (14.0.50325.0)
I hope this helps :)
Worked for me.
Window7 SP1 + VS 2013
Open a Developer Command Propmpt for VS 2012 (as administrator).
Run devenv /setup.
An even quicker fix is to simply repair the Microsoft SQL Server in the list. That fixed my problem.
Uninstalling/Repairing SQL Server Data tools is the only thing which worked for me, thanks to wayne.blackmon comment.
Picture below
For me the ActivityLog.xml stated
<errorinfo>Access to the path 'C:\Users\Klas\Documents\Visual Studio
2015\ArchitectureExplorer' is denied.</errorinfo>
When I examined this folder I realized that the entire folder structure here
C:\Users\Klas\Documents\Visual Studio 2015
had permission set so that my user had no write permissions. I added Full Control rights to my user for this folder and everything below.
After that, the message went away. Also, when I started Visual Studio it created lots of subfolders to this folder.
I had the same issue in Visual Studio 2013 for Windows 8.1.
The previous answers didn't work for me. I had to repair Visual Studio and then reboot my machine.
I was getting this error on Visual Studio start up:
the 'visual studio component model host package' did not load correctly...
After that bunch of other The '' package did not load correctly... error messages.
I realized I don't have enough free space on my C drive, where the Visual Studio were installed.
I opened up some space and restarted the Visual Studio, solved the problem.
Not sure if it has anything to do with the free space on disk though.
In my case the problem appeared after I installed Visual Studio 2015. From that point nor 2015, nor previous versions of Visual Studio would load.
The problem was the PATH environment variable exceeding the MAX length.
I shortened it to less than 2048 and restarted the machine. Visual Studio started loading, but with some errors still. Lastly run the devenv /setup, and all is back to normal.
I just had a similar error (on Windows 7. I installed Visual Studio 2015 Professional and then after that, several "...package did not load correctly" messages started showing up when I ran Visual Studio 2012).
What fixed my issue was to repair "Microsoft Studio Tools for Applications 2012".
Run "appwiz.cpl" (Control Panel → Programs → Uninstall a program
Right-click on "Microsoft Studio Tools for Applications 2012. Select "Change", then click "Repair".
After this, I can open up Visual Studio 2012 without those error messages.
I had a similar error. After I updated to VS2012.U2, the problem went away. TFS 2012 update 2 can't be removed without removing TFS. While I had an issue with upgrading from TFS2012.U1 to U2, I have found TFS2012.U2 to be worthwhile.
It was the problem with access rights to my %USERPROFILE% directory (because of the failure with the PC). Setting permissions to full access fixed it.
Another suggestion,
Run as admin, and restart the VS application.
Apply package update.
Reboot.
Hope this helps!
From MSDN forums:
Please open Windows Explorer, and navigate to <Visual Studio Installation Path>\Common7\IDE
Devenv.exe /SafeMode: Launches the IDE in safe mode loading minimal windows.
Devenv.exe /ResetSettings: Restores the IDE's default settings, optionally resets to the specified VSSettings file.
Devenv.exe /ResetAddin: Removes commands and command UI associated with the specified Add-in.
Devenv.exe /ResetSkipPkgs: Clears all SkipLoading tags added to VSPackages.
If still no help, I suggest you try repairing your Visual Studio installation or uninstall it and then reinstall it. If you want to reinstall it, I am afraid that you need a DVD or a fine Internet.
Doing the first three steps works for me.
I got "lucky" and restarted Visual Studio 2013 and it worked. I have had other errors in which deleting the temp cache items cleared it up.
Side note. While Visual Studio 2015 is not perfect as of yet, and NuGet has become less friendly to use IMO, if my computer is restarted by the company domain network administrators OR especially when there is a computer losing power with a brown-out of some loss of power Visual Studio 2013 becomes a bit a "fun" to fix while Visual Studio 2015 projects for months seem to just open just fine as if nothing happened when I login.
In my case, I solve this problem by removing the Read-only attribute of the folder "Visual Studio 2015" in <C:\Users\myuser\Documents>.

Not a valid Office Add In

I developed a new Office 2007 addin using VS 2008 and VSTO. after this I go to
Office->Excel Options->AddIns->COM AddIns and GO... If I select the .dll which I ve created I get the error
'<path>' is not a valid Office Add In.
If I run it using the Visual Studio 2008 at my development machine, it works fine and I see the add-in.
I searched so many posts but didn't get a solution.
Excel kept rejecting the Add-In, so the solution for me was doing it directly via the registry.
Save the below text as a .reg file, replace the Manifest path and FriendlyName to suit your PROJECT and double click the reg file to add the key to the Registry.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins\PROJECTExcelAddIn]
"Manifest"="file:///C:\\TFS\\Pg.PROJECT\\PROJECTExcelAddIn\\Src\\PROJECTExcelAddIn\\PROJECTExcelAddIn\\bin\\Debug\\PROJECTExcelAddIn.vsto"
"FriendlyName"="PROJECTExcelAddIn"
"LoadBehavior"=dword:00000003
"Description"="PROJECTExcelAddIn - Excel add-in for PROJECT."
VSTO does not create COM Addins. You will need to install your add-in on non-development machines. The article Adding the Office Primary Interop Assemblies as a Prerequisite in your ClickOnce installer at http://blogs.msdn.com/vsto/archive/2008/05/08/adding-the-office-primary-interop-assemblies-as-a-prerequisite-in-your-clickonce-installer-mary-lee.aspx will get you started.
Actually, you'll have to publish the addin. Then, the Visual Studio will create a folder in Debug folder named app.publish folder with other folders in and, the important thing, a setup file named setup.exe.

Resources