Cannot debug outlook 2007 project on outlook 2007? - c#

I'm getting the error 'You cannot debug or run this project, because the required version of Microsoft Office application is not installed'
The project was created as an Outlook 2007 add-in and Outlook 2007 is definitely installed. I can even manually deploy it by running the VSTO file after building the project, but still get that message when attempting to debug.
is there a value I have to change somewhere to make it work again?

Have you check the condition in your project build rules that triggered this error? (which line in .vcproj file?)
If it's not a new project, you could try to create a new one, check whether it works and compare your project with the new one for differences (.vcproj file)

Related

Windows Installer package for VSTO addin In Word 2007

I have a Visual Studio installer in VS 2013. This works fine for Word 2010 and Word 2013 but on Word 2007 it doesn't install correctly although the installer runs and says its successfully installed. After install, when I open Word 2007, the addin isn't ticked. If I then tick the addin and press ok, nothing happens and then if I look again, the addin is no longer ticked. If I look in the registry, the install package has failed to create the registry setting I have in my install package. Even if I manually create these, I still have the same issue in Word which suggests something else in the installer hasn't works although it seems to have put all the files in the right place, so i'm quite confused.
Note that I'm confident the addin itself is all fine in Word 2007 because when I build and run the addin with Word 2007, it all works correctly so i don't think there should be an issue with PIA's or any reference in the project etc.
Any help is much appreciated.
UPDATE: When I change the installation setting to write to current user instead of local machine, the registry correctly gets written too and the addin appears ticked and can see the ribbon. However when running anything on the ribbon that reads the project settings, it doesn't work. I have found that double clicking the vsto file fixes this, but i shouldn't need to do this.
UPDATE2: I have found a solution to the second part of my question (the need to double click the vsto for the settings to work). The manifest file if the registry must start "file:///" for Office 2007.

Issues getting a 2010 VSTO outlook plugin working on Outlook 2013?

I have an outlook plugin built with Visual Studio 2010 (.net 4.0 Client Profile), that works fine in Outlook 2007 and Outlook 2010. I just tested on 2013 and even installing the addin seems to crash. After googling, I see a few examples of issues people have faced but fundamentally can't get a straight answer to this question:
Is there any prerequisite that would not allow a VS 2010 Outlook addin to just work on 2013 or do I need to upgrade Visual Studio and Create an Outlook 2013 specific version of my addin?
The Running Solutions in Different Versions of Microsoft Office article describes all details. It states the following:
If you developed solutions for Office 2010, you can run the same solutions in Microsoft Office 2013. Solutions that were created by using Visual Studio 2013, Visual Studio 2012 or Visual Studio 2010 can run in Office 2013, Office 2010, or the 2007 Microsoft Office system.
What is the target .Net framework of your add-in? Did you try to debug the code? Do you get any exceptions?
Do you have Outlook 2013 on the machine you have the add-in project on? If you do, you can debug from VS 2010 by setting the "Start external program" in the Debug tab of the project properties window to the Outlook 2013 .exe. When I created my add-in I was able to debug it using whatever version of Outlook was on my development computer and I don't remember changing anything other than the external program path.
If you are using setup project for the installation it needs a different ComponenedId when you create its launch conditions. You'll need two different setup projects to install on Outlook 2010 and 2013. Here are the Office 2013 PIA keys and Office 2010 keys.
Did you try enabling the add-in again? It won't run after its in the disabled queue. After you re-enable it from the disabled add-in screen, you can then check the box in the COM-AddIn screen to have it load which then should prompt you more detail since you set the VSTO_SUPPRESSDISPLAYALERTS variable about what may have happened in the first place.
The problem can be that the add-in had been hard disabled by Outlook. Notice that the add-in did not show up under Inactive Application Add-Ins, but rather under Disabled Application Add-Ins. That makes a difference: In the latter case, just going to the COM-AddIn screen and ticking the check box is not enough to solve the problem.
Follow these steps for hard disabled add-in?
Goto the Manage box, change COM Add-ins to Disabled Add-ins, and then
click Go. Select the add-in and click Enable. Click Close. OK, now
the add-in can be loaded again:
In the Manage box, change Disabled Add-ins to COM Add-ins, and then
click Go. select the check box next to the disabled add-in. Click
OK.
Reference THIS site for further details.
I vaguely remember encountering an AddIn crashing on installation in the past... resolution is:
Install Visual Studio 2010 Tools for Office Runtime on the target machine.
Try the VSTO AddIn install again and you wont get the crash during installation.
Before trying to install it, you can try to run it trought the debugger to have more info on the real problem. As far as I remember, you just need to go to your project properties and change the launched version of outlook while debugging...
You can follow this link for more info : http://www.greycastle.se/vsto-project-office-target-version/
Assembly Loading issues are difficult to debug because there are at least two layers to this when dealing with Managed and Native code.
When an executable is started the native loader must find the file, load it into memory along with all the dependent DLLs to make it run.
The native loader looks into the assembly manifest to determine this information and then simply hunts down all the DLLs and load them into memory (in order).
You can easily see this process using WINDBG and pointing to an EXE and running it from Windbg. The list of modules being loaded is the native loader at work.
If a dependency is a .NET managed code assembly then the native loader transfers the loading request directly to the managed loader, known as "Fusion".
You can easily set up the FusionLOG viewer to see what is happening http://msdn.microsoft.com/en-us/library/vstudio/e74a18c4%28v=vs.100%29.aspx
Failures of loading at either the managed layer or within the managed layer are easily spotted either through WINDBG for Native or the Fusion Log View for Managed code.
A few hints on Managed DLL loading: If an assembly holds a reference to a dll that is not included in that assembly, there is a strict order of "probing" which is followed to find the dll. There will be a minimum of three attempts to find the DLLs in different places such as in the assembly, in the program root path and in the GAC. If the three attempts fail, loading is stopped at that point and the program will not run. When this happens it is often considered a system level environmental issue; however, in reality it's a programming issue because unless pre-requisites are fully know by the system administrator there is no way they can guess at this stuff. If you are a programmer who is including other dependent dlls you should always consider whether or not to place them into the assembly to stop this problem. Otherwise you, the system admins, and folks using your program will have to wait until the root cause is determined which takes a long time.
You may say, well I was told by another department to use this dll and I have no idea what the other dependencies are! This is no excuse, as there are excellent tools such as ILDASM and even managed code Dependency walkers that will tell you everything that's needed. The best way to package these "other" dlls is to simply include them in your assembly.

Creating a custom Excel add-in

I'm trying to create a custom Excel add-in.I currently have Visual Studio Ultimate 2013 and Microsoft Excel 2010.The problem that I currently have is that when I create a new Excel Add-in project and I try to build, it says that I haven't got a proper version of Office installed and it provides a link for reference. Whenever I visit the link it actually says that Excel 2010 is supported. Whenever I start excel it actually loads the add-in in the list of installed add-ins,but I cannot debug or run it in Visual Studio! Has anyone had any problems with this?

Distributing Outlook Add-In from Visual Studio 2012

I've written an Outlook add-in for our office that I'd like to make available to others for testing.
My Googling has indicated that I should make an InstallShield project in the solution and use that, however my Visual Studio install only opens an InstallShield download page for which there is a dead link.
Following this failure, I attempted to manually add the add-in to Outlook by utilizing the files in the bin directory, but it tells me that it is an invalid add-in.
I'm at a bit of a loss here on how to proceed in making this add-in available for distribution.
You could use click-once, right click the outlook project in solution explorer and select publish and follow the wizard. The only problem would be that you will need to sign the click-once app because office addins are particular about security.
This question has further details.

Visual Studio Add-in - How do I create an Installer?

I have made a Visual Studio Add-in as part of a project I'm working on using web services.
When I created the new Add-in project in visual studio it generated all the code required and installed the blank add-in on my pc (I assume).
Since this is a large project we are using svn to manage the code base and once I had done some of the work on the Add-in I commited it, then checked it out on a different pc and attempted to run it.
However on the other pc when I run the add-in in debug mode, the tools entry for the add-in is not present and I can't run the add-in.
Am I right in assuming that when I created the project on the other pc it installed the plugin as well? And does that mean that I will need to create an installer for any other pcs I wish to use?
Obviously at some point I intend on making an installer anyway but not untill after the development of the addin is complete.
Ok so I fixed my issue.
after doing some googling into a different issue I was having I stumbled apon the answer to my installer issue.
When the visual studio Add-in wizard creates your blank add-in it creates two xml files with the .Addin extension.
One of these is saved locally along with your project the other is copied to whatever path that copy of visual studio uses for its add-in folder.
So by copying the .addin file to the correct location on my other pc I can now run the Addin in both locations.

Categories