Microsoft.Office.Core Reference Missing

C#OutlookAutomationComMs Office

C# Problem Overview


Using the example provided in codeproject I am struggling to work out where I can find the reference to the library Microsoft.Office.Core.

I am getting the error "The referenced component 'Microsoft.Office.Core' could not be found."

I only have office 2007 enterprise edition and outlook 2003 installed on this system. Could this be the cause of this? Otherwise which specific dll am I supposed to be referencing?

C# Solutions


Solution 1 - C#

You can add reference of Microsoft.Office.Core from COM components tab in the add reference window by adding reference of Microsoft Office 12.0 Object Library. The screen shot will shows what component you need.

enter image description here

Solution 2 - C#

None of the above answer helped me, i was using Visual Studio 2017. What I did is, installed Office/SharePoint Development using Visual Studio Installer.

enter image description here

After that, I was able to see 'office', this assembly contains Microsoft.Office.Core.

enter image description here

Hope this helps you.

Solution 3 - C#

You need to download and install the PIA (primary interop assemblies) for the version of Office you are using. Once installed you can then add a reference to your project and they will be available from the add reference dialog. Here are the links to download them...

Office 2010 PIA

Office 2007 PIA

Office 2003 PIA

Solution 4 - C#

If someone not have reference in .NET . COM (tab) or not have office installed on machine where visual was installed can do :

  1. Download and install: Microsoft Office Developer Tools

  2. Add references from:

     C:\Program Files (x86)\Microsoft Visual Studio 11.0\Visual Studio Tools for Office\PIA\Office15
    

Solution 5 - C#

After installing the Office PIA (primary interop assemblies), add a reference to your project -> its on the .NET tab - component name "Office"

Solution 6 - C#

Now there is a nuget package for that.

https://www.nuget.org/packages/NetOffice.Core.Net40/

First I didn't find office in COM, so tried this nuget and it worked!

Solution 7 - C#

You can use this NuGet package which includes the interop assemblies in addition to the office assembly.

https://www.nuget.org/packages/Bundle.Microsoft.Office.Interop/

Solution 8 - C#

Have you actually gone to your references and added a .NET reference to the 'Microsoft.Office.Core' library? If you downloaded the example application, the answer would be yes. If that is the case, follow the advice in the article:

> If your system does not have Microsoft Office Outlook 2003 you may have to change the References used by the "OutlookConnector" project. That is to say, if you received a build error described as "The type of namespace name 'Outlook' could not be found", you probably don't have Office 2003. Simply expand the project references, remove the afflicted items, and add the COM Library appropriate for your system. If someone has a dynamic way to handle this, I'd be curious to see you've done.

That should solve your problem. If not, let us know.

Solution 9 - C#

In case you are using Visual Studio 2012, for this to work and in order to make reference to Microsoft Office Core, you have to make the reference through Visual Studio by clicking on the top menu's Project, Add Reference, Extensions button and checking office which is now (14.0).

Solution 10 - C#

If you are not able to find PIA for Office 2013 then follow these steps:

> 1. Click on Solution Explorer in Visual Studio > 2. Right click on your project name (not solution name) > 3. Select 'Manage Nuget packages'

  1. Click on Browse and search for PIA 2013, choose the shown PIA and click on Install.....

And you are done.

Solution 11 - C#

I faced the same problem when i tried to open my old c# project into visual studio 2017 version. This problem arises typically when you try to open a project that you made with previous version of VS and open it with latest version. what i did is,i opened my project and delete the reference from my project,then added Microsoft outlook 12.0 object library and Microsoft office 12.0 object libraryMicrosoft outlook 12.0 object library

Solution 12 - C#

In my case when I added "Microsoft Excel Object Library" and "Microsoft Office Object Library" from Reference->COM then the reference error goes away.

Solution 13 - C#

I have the same trouble. I went to Add references, COM tab, an select Microsoft Office 15.0 Objetct Library. Ok, and my problem ends.

part of my code is:

EXCEL.Range rango;
            rango = (EXCEL.Range)HojadetrabajoExcel.get_Range("AE13", "AK23");
            rango.Select();
      //      EXCEL.Pictures Lafoto = (EXCEL.Pictures).HojadetrabajoExcel.Pictures(System.Reflection.Missing.Value);
            EXCEL.Pictures Lafoto = HojadetrabajoExcel.Pictures(System.Reflection.Missing.Value);
            
            HojadetrabajoExcel.Shapes.AddPicture(@"D:\GENETICA HUMANA\Reportes\imagenes\" + Variables.nombreimagen,
                Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue,
                float.Parse(rango.Left.ToString()),float.Parse(rango.Top.ToString()), float.Parse(rango.Width.ToString()),
                float.Parse(rango.Height.ToString()));

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMaxim GershkovichView Question on Stackoverflow
Solution 1 - C#AdilView Answer on Stackoverflow
Solution 2 - C#AbhimanyuView Answer on Stackoverflow
Solution 3 - C#Phil WrightView Answer on Stackoverflow
Solution 4 - C#Artur TarnowskiView Answer on Stackoverflow
Solution 5 - C#SpikeView Answer on Stackoverflow
Solution 6 - C#Mr. OttView Answer on Stackoverflow
Solution 7 - C#Matt ScullyView Answer on Stackoverflow
Solution 8 - C#IAmTimCoreyView Answer on Stackoverflow
Solution 9 - C#HumbertView Answer on Stackoverflow
Solution 10 - C#DeepeshView Answer on Stackoverflow
Solution 11 - C#Jobayer RifadView Answer on Stackoverflow
Solution 12 - C#Nahidul IslamView Answer on Stackoverflow
Solution 13 - C#Giovanni Rodrigo Garcia RadaView Answer on Stackoverflow