The Microsoft.Build.Tasks.Delete task could not be loaded from the assembly…

10Jun09

When building a Visual Studio sequential workflow created from a C# class library project, you may get one or all of these errors:

The “Microsoft.Build.Tasks.Delete” task could not be loaded from the assembly C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Build.Tasks.dll. Could not load file or assembly ‘file:///C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Build.Tasks.dll’ or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. Platform.StagingAnalysis.Workflow

The “Microsoft.Build.Tasks.Delete” task could not be loaded from the assembly C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Build.Tasks.dll. Could not load file or assembly ‘file:///C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Build.Tasks.dll’ or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. Platform.StagingAnalysis.Workflow.Services

The “Microsoft.Build.Tasks.Delete” task could not be loaded from the assembly C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Build.Tasks.dll. Could not load file or assembly ‘file:///C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Build.Tasks.dll’ or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. Platform.StagingAnalysis.Workflow.ConsoleHost

PROBLEM:

The .NET version in the <Import Project /> node in your .csproj file does not match up with the version of the project.

SOLUTION:

 Make sure your <Import Project /> line looks like this:

<Import Project=”$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets” />

Or if the project is not 3.5, replace with the correct version.



One Response to “The Microsoft.Build.Tasks.Delete task could not be loaded from the assembly…”

  1. 1 Shruti

    Thank you. Saved lot of effort.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.