确认<usingtask>声明是否正确?

时间:2016-02-22 11:42:36

标签: postsharp

我在我的项目中使用postharp。当我试图建立解决方案时,我得到了跟随错误。 &#34; The "PostSharp.MSBuild.PostSharp30DetectNativeFrameworkVersion" task could not be loaded from the assembly C:\ProgramData\PostSharp\3.1.49\bin.Release\PostSharp.MSBuild.v3.1.49.Release.dll. 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.&#34;

如何解决这个问题?

谢谢

1 个答案:

答案 0 :(得分:0)

我刚才遇到了这个问题。我改变的最后一件事是添加一个post-build事件(.dll和.pdb的副本到另一个目录)。

我最初没有'连接'这两个事件,我仍然不确定是否有连接,而是检查PostSharp.MSBuild.v{version}.Release.dll是否存在 - 在我的情况下它不是。我从所有项目中删除了PostSharp NuGet包,删除了包目录并重新安装了包。之后PostSharp.MSBuild.v{version}.Release.dll确实存在,但这并没有解决问题。

我记得我已经添加了一个postbuild copy事件并删除了我重启了我的IDE。只有在完成这两件事之后我才会尝试再次构建解决方案 - 这是有效的。

我再次添加了postbuild事件并点击了rebuild,它也有效。因此,我不能完全确定是否可以通过重新安装NuGet包并重新启动Visual Studio或者如果postbuild copy命令出现问题来解决问题。