How to install Microsoft.Office.Interop references in VS.NET 2010? - visual-studio

I was trying to create a windows forms using the Microsoft.Office.Interop libraries, but I cannot find them. I tried to follow the guides only and installed the Microsoft Office 2010: Primary Interop Assemblies Redistributable, but the references did not show up in the COM tab. I closed VS.NET, restarted my computer and they still did not show.
I am using Visual Studio 2010 with .NET Framework 4.0.3.

PIA is just an interop layer, you need Office installed to see a COM reference. If you reference a COM type library, AND a corresponding PIA is installed correctly, your reference will be replaced by a PIA one. You can also reference the PIA directly by browsing to its folder and add reference, but the PIA won't be functional unless you have Office installed.

Related

Not able to install Nuget Package Manager in Visual Studio 2015

Until now I only used Visual Studio for Business Intelligence development and now I have to do something in C# that uses Google Drive API which has to be installed through NuGet Package Manager. Unfortunately I don't see this particular package in Visual Studio Extensions and Update manager. I though it may be related to lack of Tools > NuGet Package Manager > Package Manager Console option in my VS, so I wanted to install package manager. I downloaded .vsix file, but when I try to install, it fails with message This extension is not installable on any current installed products. I got VS 2015, 2013 and 2010 installed.
So if I'm not able to install package manager, there is at least any way to install google drive api without involving NuGet?
Drive api package name: Google.Apis.Drive.v3
EDIT: I did reset all Visual Studio settings since it was set for Business Intelligence development, but this didn't help as well.
Please make sure your Visual Studio 2015 has installed the latest update. The latest version for Visual Studio 2015 should be version 14.0.25431.01.
If your Visual Studio 2015 is the latest version, please try repair your Visual Studio 2015 to check whether there has any installation issue.
And you also can install nuget packages without NuGet Package Manager. Please download the NuGet package and unzip it to local folder, which will list all content of this package. Then add the dlls in the unzipped folder into your project through Add Reference.
You do realize that SSDT and BIDS are for use with project types that are specific to SQL Server business intelligence. Business Intelligence Development Studio is the primary environment that you will use to develop business solutions that include Analysis Services, Integration Services, and Reporting Services projects.
To my knowledge you are not going to be able to install NuGet on it or use it to develop an actually C# application.
I am going to take a wild guess here and say you are trying to use google drive with a Script task. You can do this I did it a number of years ago. The set up is a bit weird. Your going to have to create a normal C# application in NORMAL visual studio with Nuget and it will install all of the Dlls for you at that time.
Now that you have all of the dlls. You are going to have to dump them in GAC and the folders that SSIS needs
C:\Program Files (x86)\Microsoft SQL Server\100\DTS\PipelineComponents
The 100 part changes depending upon which version of Sql server you are using
2005 = 90
2008 = 100
2014 = 110 (I think I cant remember)
Once the dlls are in the correct folders you should then be able to use it in a scripting task.
Note: I am not 100% sure any of this will even work anymore. When I did it the client library still supported .net 3.5. Now you need to be able to use .Net 4.5 I am not sure if the newer version of Sql server will be able to handle the higher level of .net dll or if they all require 3.5.
Checked with a coworker his guess is that Sql server 12+ should support .Net 4.5 dlls.

Updating an Office 2010 Add-In to support inline response in Office 2013

I currently have one Add-In project that supports both 2010 and 2013 versions of Office. The only difference is the setup project I use to install the Add-In. One searches for the 2010 PIA and the other for the 2013 PIA. I'm able to support both versions this way. The only problem is that since I'm using the v4.0 libraries I can't access the tools for supporting inline response in 2013.
I currently have Office 2013 and Visual Studios 2010 installed of my machine, can I updated the references from the Office 2013 installation? I understand that if I update my project to support the inline responses, it might brake the compatibility with 2010. This is fine as I can just have two projects.
Do I need VS2012 or higher to support the Office 2013 libraries?
Okay, this took a little while to figure out. All you need to do is delete the Microsoft.Office.Interop.Outlook and stdole and add the Microsoft Outlook 15.0 Object Library reference. I couldn't find the PIA for the Office 2013 originally as they show up as COM instead in .NET in the Add Reference form in VS2010.
After that, the this.Application.ActiveExplorer() should have inline response events. You don't need VS2012 to support the libraries. While I separated the inline response code by checking the application version, I haven't had the chance to test on Outlook 2010 to make sure it works. I'll edit this answer once I do.

VSTO project with multiple versions of office installed

I currently have office 2010 installed, and am trying to assist a coworker who's still using 2007 with VSTO solution. This is turning into a mess since my copy of visual studio thrashes the project files updating them to point to the O2010 dlls. If I were to install office 2007 beside 2010 would I be able to open the solution without the upgrade wizard mangling everything, or are my only options making significant architectural changes to the solution or reverting to O2007 until my employer makes O2010 the new standard.
You cannot run Outlook versions side-by-side (and here).
You can still target both 2007 and 2010, but you need to research embedded interop types.
You shouldn't need to install Office 2007 to create Office 2007 add-ins. I think the problem here is that you're missing the proper VSTO components.
Make sure you've installed the following:
All .NET and developer tools from Office (from the Office 2010 installer -- no need for the Office 2007 installer)
Microsoft Office Developer Tools from Visual Studio (from the VS installer)
Microsoft Office 2007 Primary Interop Assemblies
Microsoft Visual Studio 2010 Tools for Office Runtime
Microsoft Visual Studio Tools for the Microsoft Office system (version 3.0 Runtime)
If any of these are already installed then I recommend repairing their installations.
Try disabling this option:
Options > Office Tools > Project Upgrade > Always upgrade to installed version of Office (more info here)
I don't think this solves the root problem which is that you shouldn't even be prompted to upgrade your project. I still suspect that there is something wrong with the installation of your VSTO-related components (see my other answer for that info). However this may be an easy workaround.
To be clear, you can develop Office 2007 add-ins without having Office 2007 installed. I'm doing so right now without having to follow this workaround.

VS2005 - Unable to add reference to Microsoft.Office.Interop.Word (Office 2010)

Running WinXP SP3, Visual Studios 2005, .NET 2.0. Recently upgraded machine from Office 2007 to Office 2010 sp1.
I had a project that referenced Microsoft.Office.Interop.Word and when I reopened it the reference was not found. I've checked the Office install CD and ".NET Programmability Support" is selected as installed. If I go to C:\Windows\assembly I see Microsoft.Office.Interop.Word Version 14.0.0.0 installed on the list.
When I go to Add Reference .NET tab, the only Office references I see are Microsoft.Office.Tools.Common, Microsoft.Office.Tools.Excel, Microsoft.Office.Tools.Outlook, Microsoft.Office.Tools.Word.
I can go to the COM tab and add Microsoft Office 14.0 Object Library to get the reference to Microsoft.Office.Core. However I have been unable to find a way to reference the Interop assembly.
Doing a file search on my machine for Microsoft.Office.Interop.Word.dll also finds no matches.
I've repaired the Office install and still no luck. I also tried to install the PIAs directly, same behavior.
Could this be an issue with trying to use Office 2010's interop assembly with VS2005? I saw online that the directory the dll is found in is usually under Program Files\Visual Studios 10.
Any thoughts on what step I'm missing?
You can install Office 2010 PIA separately. Installer can be downloaded from http://www.microsoft.com/download/en/details.aspx?id=3508

VSTO Development with Office 2003 and 2007 installed side-by-side?

Does VSTO 3.0 (using Visual Studio 2008) support both Office 2003 and Office 2007 installed side-by-side on a single development computer so that both Office 2003 and Office 2007 can be targeted (in separate solutions)?
I have seen conflicting information about this.
NO: http://msdn.microsoft.com/en-us/library/bb398242.aspx
Visual Studio Tools for Office does not support installing Microsoft Office 2003 and the 2007 Microsoft Office system (or different versions of the same application, such as Word 2003 and Word 2007) side-by-side on the development computer. To develop solutions for different versions of Microsoft Office, use a different development computer for each version of Microsoft Office.
YES: http://msdn.microsoft.com/en-us/library/15s06t57.aspx
When you install Visual Studio Tools for Office, the primary interop assemblies are automatically installed to a location in the file system, outside of the global assembly cache. When you create a new project, Visual Studio Tools for Office automatically adds references to these copies of the primary interop assemblies to your project. Visual Studio Tools for Office uses these copies of the primary interop assemblies, instead of the assemblies in the global assembly cache, to resolve type references when you develop and build your project.
These copies of the primary interop assemblies help Visual Studio Tools for Office avoid several development issues that can occur when both the 2003 and the 2007 versions of the Office primary interop assemblies are registered in the global assembly cache.”
Has anyone done this and were there any problems?
You can target both 2003 and 2007 with the same computer - but you need two different programs for that in Visual Studio (e.g. MyCoolThingfor2003.sln and MyCoolThingfor2007.sln) as they have different interops. But you should not have both Office programs installed on that same computer.
You can't install Office 2003 and 2007 side by side. The two links you posted talk about different things. The first link says no to installing the actual Office 200x application, whereas the second link refers to the PIA (which is just a wrapper). You can install any version of the PIAs on a computer side by side, but it doesn't mean it'll launch different versions of office.
If your goal is to develop a VSTO addin that supports both Office 2003 and Office 2007, then you'll need to develop on a system with VS2008 + Office 2003.

Resources