Open sandboxFocusImprove this doc

PS0013: Implementation Type of a Task Not Found

Severity Error
Reported by PostSharp
Message Task "<TaskName>": cannot find the implementation type "<Implementation>".

Cause

PostSharp builds a project by running tasks, which plug-ins add. A plug-in can declare its tasks in an XML configuration file, such as a .psplugin file, with TaskType elements. The Implementation attribute of a TaskType element gives the assembly-qualified name of the class that implements the task, for example Contoso.Weaver.AuditTask, Contoso.Weaver.

PostSharp reports PS0013, and stops building the project, when it loads the assembly that <Implementation> names, but this assembly does not contain the type. <TaskName> is the Name attribute of the TaskType element. The usual causes are:

  • The configuration file of the plug-in and its assembly come from different versions of the plug-in, and the class was renamed or moved to another namespace.
  • The type name in the Implementation attribute is misspelled, or lacks its namespace.

When the assembly itself cannot be loaded, PostSharp reports another message, which names the assembly.

This message depends on the configuration of a plug-in of PostSharp, which the samples of this documentation cannot build, so no example can show it.

Resolution

  • When the plug-in comes from a NuGet package, restore the packages, and check that every package of the plug-in has the same version as the other PostSharp packages of the project.
  • When you develop the plug-in, make the Implementation attribute give the full name of the class, with its namespace, followed by a comma and the name of the assembly.
  • To see which configuration files and assemblies PostSharp loads, build with the PostSharpTrace MSBuild property set to ProjectLoader, and a build log verbosity of at least normal. See Well-Known MSBuild Properties.

See Also

Other Resources

Configuration File Schema Reference
Well-Known MSBuild Properties