I am trying to compile some C++/CLI using MSBuild. I am getting an error:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppClean. targets(74,5): error MSB4062: The "CppClean" task could not be loaded from the assembly Microsoft.Build.CppTasks.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Could not load file or assembly 'Microsoft.Build.CppTasks.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the 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.
A colleague of mine has fixed this error by installing Visual Studio 2010 SP1 on his machine, but I already have that installed (as well as Visual Studio 2012 with Update 1) yet am getting this error. I have checked the path from the error message, and both the Microsoft.CppClean.targets
and Microsoft.Build.CPPTasks.Common.dll
files exist.
The CPPClean task appears to be part of the MSBuild tasks specific to Visual C++. Is there any way to get this as a separate installer so that I can repair it, or as part an installer for another set of tools? Failing that, is there another way of fixing this error?
Microsoft.Build.CPPTasks.Common.dll
containCppClean
class? You can check it with dotpeek / reflector. I.e. idea is to understand is it issue with a build, or with DLL? – LanorkinCppClean
task is in the assembly. – adrianbanksUsingTask TaskName="CppClean" AssemblyName="Microsoft.Build.CppTasks.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
You can usegacutil /l
to check – Lanorkin/p:VisualStudioVersion=11.0
to MSBuild – KMoraz