构建Excel VSTO项目的错误,“FindRibbons”任务意外失败.System.ArgumentException:VS 2013中的URL上的目录无效

时间:2015-08-25 20:11:48

标签: c# .net excel visual-studio-2013 vsto

我正在尝试将VS2010(C#.net 4.0)项目转换为VS2013。在该解决方案中,共有6个项目,包括MyApp.Excel,MyApp.Host,MyApp.WCF,MyApp.Web,SetupAction,MyAppSetup。

MyApp.Excel是一个EXCEL VSTO项目。它最初是为Excel 2003设计的。我是否需要做一些事情才能使其支持Excel 2010?在转换之前,可以在Excel 2010中打开应用程序的Excel加载项。

MyAppSetup是一个MSI安装程序项目。我从

安装了VS安装程序项目扩展

http://blogs.msdn.com/b/visualstudio/archive/2014/04/17/visual-studio-installer-projects-extension.aspx

现在,我可以在VS2013中构建除MyApp.Excel和MyAppSetup之外的所有项目。后者取决于第一个。

在MyApp.Excel中,我遇到了构建错误:

 Error 11   The "FindRibbons" task failed    unexpectedly.System.ArgumentException: Invalid directory on URL.

服务器堆栈跟踪:

at System.Security.Util.DirectoryString.CreateSeparatedString(String directory)
at System.Security.Util.URLString.ParseFileURL(String url)
at System.Security.Util.URLString.ParseString(String url, Boolean parsed)
at System.Security.Util.URLString.GetFileName()
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.ReflectionOnlyLoadFrom(String assemblyFile)
at Microsoft.VisualStudio.Tools.Office.BuildTasks.FindRibbons.FindRibbonTypes(String assemblyName)
at Microsoft.VisualStudio.Tools.Office.BuildTasks.FindRibbons.Execute()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]: 
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& m sgData, Int32 type)
at Microsoft.Build.Framework.ITask.Execute()
at  Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() MyApp.Excel

我搜索过/试过很多相关的解决方案,但没有一个能为我效劳。

https://social.msdn.microsoft.com/Forums/vstudio/en-US/5831d519-ba81-413a-9936-efe0ff328348/vsto-project-fails-to-build-i-get-the-following-error-msb4018-the-find-ribbons-task-failed?forum=vsto

https://social.msdn.microsoft.com/Forums/vstudio/en-US/c86f8d52-7c33-41a6-b37f-593a218858ce/findribbons-task-failed-unexpectedly?forum=vsto

Assembly binding error when building Office add-in: "FindRibbons" task failed unexpectedly

FindRibbons task failed unexpectedly when building addin for Outlook 2010

http://www.wpthm.com/t/ibs13h11mmvs6v799stssrkbskvri39s

错误是什么意思?怎么解决?

1 个答案:

答案 0 :(得分:0)

如果从以前版本的Visual Studio迁移项目,请务必从AssemblyInfo.cs文件中删除 ExcelLocale1033 SecurityTransparent 属性。 因为.Net框架4及更高版本内部处理了属性。