Partial functionality of Addin with Windows Installer - visual-studio-2010

I have had some trouble with my Excel Addin and the Windows Installer. I tried following the steps as set out in the demo (shown on Pluralsight) on a test project and it works fine.
For my custom addin, I used VS2010 and the addin targets Excel 2007. There are more projects in my solution than only the Addin project and the setup project. After I have run the msi file that I created with the setup project, then if I have a message box in the ThisAddIn_Startup method of the ThisAddin.cs class, then it shows the messagebox, but it does not display the Ribbon tab that I created in the same project. I have tried to see whether any errors show up by creating the VSTO_SUPPRESSDISPLAYALERTS and VSTO_LOGALERTS variables, but I don't see any logfiles. After I build the projects and create the msi and setup.exe files, I clean the solution in Visual Studio, and try the installation from the external msi file, since I'm testing this on the development computer for now. Perhaps I should add, that if I run the setup.exe file, I don't even get the messagebox.
My addin is not disabled, and is ticked in the COM-Addins dialog. I have the registry set up for HKEY_CURRENT_USER.
Why do I see the messagebox, but not my tab on the Ribbon?

I found that there was an exception when the Ribbon loaded, and this is why it did not show. When I cleared that problem, the Ribbon loaded correctly. The exception was not picked up by the debugging though, it just silently malfunctioned.

I believe you are using Ribbon XML not the Ribbon designer.
If Ribbon XML then add the following code in to your ThisAddin.cs
protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
{
return new Ribbon1();
}

Related

installed shortcut causing install to rerun visual studio 2010

I am using the Visual Studio 2010 setup to create an installer for my application. From the File system Editor i have selected one of the two primary output files that have been created in my solution. I have right clicked and created a shortcut for my executable. I have dragged and droped the shortcut into the User's Program Menu. I build the installer and everything completes successfully. I run the installer and everything runs successfully. Now i proceed to double click on the shortcut and the installer re-runs and fails!!!. I have checked the shortcut and it is different from the one i have manually created to compare. The Target is greyed out. Any help would be greatly appreciated!!!
When launching an application through an advertised shortcut, Windows Installer verifies if the application resources are intact. If one or more resources are missing, Windows Installer reinstalls them automatically using the cached MSI. This is why the second installation is performed.
Shortcuts created in Visual Studio are advertised, so a repair is triggered if some of your installed files are missing.
To determine what triggers the repair you can try this:
after receiving a “preparing to install” message open Event Viewer (you can search it in the Start menu or launch “eventvwr.msc”)
go to “Windows Logs” -> “Application”
look for “MsiInstaller” information messages which have this form:
Event Type: Warning
Event Source: MsiInstaller
Event ID: 1001
Description: Detection of product '{1F7D16F0-836D-4CE4-9123-D30B2F24A17B}', feature 'FeatureId' failed during request for component '{068153F4-B9E0-4745-9A47-833764D9D60C}'
The GUIDs will be different on your machine, but they can help you identify which component is causing the problem. The first GUID is your package ProductCode and the second one is for the problematic component. Try creating an installation log and see why the component is not installed correctly.
This ended up being an issue with the registry hive. The Visual Studio 2010 Registry editor would allow me to specify values in 'HKEY_USERS(64)\S-1-5-20\Fileopen. This however was the reason for the error above. That is, you can't have values in this part of the registry when it is being generated using setup and deployment from Visual Studio 2010. I moved the values to exist under local_Machine and the short cut work like a charm.

Visual Studio : Language Service Error

I'm trying to compile a project I have in Visual Studio 2010. It has built fine on 2 other computers with Visual Studio, but on this computer, it will not compile, and returns:
"The property could not be read/written because the language service returned an unknown error"
Obviously, I have tried googling, and nothing of any use came up, so some help would be great.
Additional Information:
Project is an XNA 4.0 Project
Trying to deploy the solution to a Windows phone. The phone is plugged in, unlocked, etc. and other projects will deploy successfully to it.
I've run into the exact same error message when I tried editing the AssemblyInfo.cs using VS 2010's Assembly Information dialog from within the project properties (open Properties -> Application from below the given project).
As this thread suggests, I deleted the AssemblyInfo.cs file and filled in the values I wanted in the dialog box which created a new and working AssemblyInfo.cs. Maybe this would help/would have helped in your scenario as well.
Note, that you'll get a fresh and valid GUID if you simply click save after opening the dialog.
I encountered this today in VS 2017. It went away as soon as I performed a build which fetched all my references.

Outlook 2010 not launching when I debug my Outlook addin?

I'm totally confused as to how to debug an Outlook 2010 addin I'm trying to develop. I created a new Extensibility | Shared Add-in project and just checked Outlook, and it's created a new project for me with a stub implementation of the Extensibility.IDTExtensibility2 interface in my Connect.cs file. However, when I press F5 to debug, although the project compiles OK, a new instance of Visual Studio opens up instead of Microsoft Outlook! How am I supposed to debug my addin?
Since Outlook is the host process that will load your code you have to make sure that Outlook is the target application for debugging (go to project properties and select the main Outlook EXE under the Start external program option in the Debug settings).
Then of course you have to also make sure that your plugin is actually being loaded by Outlook. With that in place you should be able to debug your plug-in with VS.

Adding a service installer and service process installer in visual studio

For some reason, after adding a Installer class to my Windows Service project, I open it up in design mode and right click, but there is no option to add either a service installer or a service process installer. Does anyone know why this may be the case?
In both Visual Studio 2008 and 2010, the best way to do this is to open the ServiceBase component (named Service1 by default) in design mode. Then, right-click in the designer and select the Add Installer option. This adds a ProjectInstaller component along with the necessary assembly references. The ProjectInstaller component, in turn, has the service installer and service process installer added automatically.
Without additional detail, my best guess is that you manually added a component/class to your project and named it Installer instead of letting Visual Studio do the work for you.
See my post here for how to create a basic service in Visual Studio 2008 (seems to work in 2010 as well). Pay particular attention to Step 6.
Hope this helps.

Visio 2007 Application Add-in will not Install

I have created a VSTO toolbar application add-in for Visio 2007 (.NET Framework 4 Client Profile) using VS 2010. I first tried to publish it with ClickOnce deployment but this did not load on test pc's. After checking the msdn documentation, I then created a setup project following the instructions at http://msdn.microsoft.com/en-us/library/ff937654.aspx and still had the same result. The MSI completed but the toolbar is neither on (start at loadup option) or listed in the available toolbars when right clicking on the toolbar area.
In comparing the registries of the test PC and my development PC, I found that the key for the addin on my dev PC was HKEY_CURRENT_USER\Software\Microsoft\Visio\Addins\addinName instead of HKEY_CURRENT_USER\Software\Microsoft\Office\Visio\Addins\addinName per the instructions. I changed this in the setup project but it still had no effect. Any ideas on what else is needed?

Resources