0
votes

I am working with the msbuild script to build csproj files. Before building each project I increase the assembly version of each project. After increasing the version I run the build using msbuild command. The Non-VSTO projects build without any issues. I face a problem when building VSTO Excel Document Level Customization project. The build fails with the following error

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: The "FindRibbons" task failed unexpectedly. [D:\src\VstoAddin\VstoAddin\VstoAddin.csproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly 'VstoAddin, Version=21.1.1.0, Culture=neutral, PublicKeyToken=ff90f512e10aef0d' or one of its dependencies. The system cannot find the file specified.

I am using Visual Studio Professional 2017 15.9.26. I searched a lot regarding this error, but I could not figure out a solution. Experts in this area please give some suggestion.