3
votes

I am trying to create a simple Outlook 2010 Add-In in Visual Studio 2010. However, the build fails with the following message:

The "FindRibbons" task could not be loaded from the assembly Microsoft.VisualStudio.Tools.Office.BuildTasks, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

I found a similar question here: Build Error + Creating VSTO addin for excel 2010. But, the problem there was that asker had upgraded Visual Studio from 2010 to 2012. And I have not done an upgrade.

I have tried the solution to that question as well:

update your Microsoft.VisualStudio.Tools.Office.targets file to point to version 11.0.0.0 instead of version 10.0.0.0.)

But it gives me another error (which obviously should happen, because I haven't upgraded):

The "RegisterFormRegions" task could not be loaded from the assembly Microsoft.VisualStudio.Tools.Office.BuildTasks, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Could not load file or assembly 'Microsoft.VisualStudio.Tools.Office.BuildTasks, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Update: The error still persists after re-installing Visual Studio 2010 Tools for Office Runtime.

2

2 Answers

2
votes

The solution is to install the mentioned dll in GAC:

"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools\gacutil.exe" /i
 "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.BuildTasks.dll"

Remember to correct the dll path, depending on your version of Visual Studio.

1
votes

I had this exact same issue with Visual Studio 2013 and Outlook 2010 and found an MSDN Article (http://msdn.microsoft.com/en-us/library/ms164304.aspx) that states:

Starting in Visual Studio 2013 Update 3, this task has a new signature that allows you to specify the target framework version for the file.

Although this doesn't apply to VS2012 it does appears that the versions of Office and targets is very much tied to the version of Visual Studio you are building it with. In my case I had to ensure I was building against VS2013 Update 3 when building against Microsoft.VisualStudio.Tools.Office.targets Version=12.0.0.0 so you may want to try that combination if all else is failing.