“Exception has been thrown by the target of an invocation.” when building a Visual Studio 2010 VSPackage

﹥>﹥吖頭↗ 提交于 2019-12-01 06:45:02

I've experienced this issue several times in both vs2010 and vs2012, and manually deleting the "bin" and "obj" folders from the project then doing a "rebuild" normally does the trick.

Further to the answer provided by the OP, I will provide it here for completeness instead of relying on the external link remaining live:

Quoted directly from the MSDN forum answer:

Do you happen to have these extensions installed to the AllUsers location (i.e. %VSInstallDir%\Common7\IDE\Extensions)?

You mentioned in your initial post that "I had already installed these extensions and were working fine."

The task that's failing (based on the line number in the targets file) is the UninstallExtension task. The only reason I'm thinking this task would execute and fail in your situation is if you're building an extension that's already installed to the Common7\IDE\Extensions directory.

Regards, Aaron

I find myself on this question because of exactly the same build issue of a VSIX Installer Project for our project templates. This solved my issue.

Indeed, I uninstalled the prior version of our templates and the build occurs without issue.

Have you double checked that all of your projects are using compatible framework versions?
As in you can't use a .Net 4.0 assembly in a .Net 3.5 project.

Is the project linked with source control like TFS? If so then take latest from TFS and try again.

Are you running Visual Studio as Administrator?

Maybe you have insufficient rights for some file (copy/move/delete) especially in bin or obj folders.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!