I created a library project, using .netcore 5.0 which has a Task :
using Microsoft.Build.Utitilites;
public class SimpleTask : Task
{
public override bool Execute()
{
var processInfo = new ProcessStartInfo();
processInfo.FileName = "cmd";
Process.Start(processInfo );
}
}
I add the Task config into a another project (Project B) csproject config :
<UsingTask ... />
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<SimpleTask />
</ItemGroup>
When I build (Project B), it throws error in Visual Studio :
MSB4018 "The "SimpleTask" task failed unexpectedly"
FileNotFoundException : Could not load file or assembly 'System.Runtime Version = 5.0.0.0'
The source code : https://github.com/persiandeveloper/custom-build-task
