The "CompressorTask" task was not found.

Sep 16, 2011 at 9:31 AM

Using Scripts.xml

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="">
        AssemblyFile="Yahoo.Yui.Compressor.dll" />

        <JavaScriptOutputFile Condition=" '$(JavaScriptOutputFile)'=='' ">..\..\\javascript\offerta.min.js</JavaScriptOutputFile>

    <Target Name="ScriptTask">
        <JavaScriptFiles Include="..\..\\javascript\offerta.js"/>
           IsEvalIgnored="false" />


I run it using a bat file:

C:\Windows\Microsoft.NET\Framework\v3.5\msbuild.exe Scripts.xml


I'm getting:

"F:\Checkouts\Offerta\trunk\build\\Scripts.xml" (default target) (1)
(ScriptTask target) ->
  F:\Checkouts\Offerta\trunk\build\\Scripts.xml(16,7): error MSB4036:
 The "CompressorTask" task was not found. Check the following: 1.) The name of
the task in the project file is the same as the name of the task class. 2.) The
 task class is "public" and implements the Microsoft.Build.Framework.ITask inte
rface. 3.) The task is correctly declared with <UsingTask> in the project file,
 or in the *.tasks files located in the "C:\Windows\Microsoft.NET\Framework\v2.
0.50727" directory.

What am I doing wrong? I'm using Yahoo.Yui.Compressor (for .NET 3.5)

Sep 16, 2011 at 1:33 PM

two questions.


1. What is the path of the file Yahoo.Yui.Compressor.dll ? (eg: c:\foo\pewpew\etc..)

2. Where are you running the command line from? eg. F:\Checkouts\Offerta\trunk\build\\Scripts.xml 
   Is that the location/path?

if so, u need to make sure the  Yahoo.Yui.Compressor.dll can be found/seen by msbuild from the location u run the command. So either copy Yahoo.Yui.Compressor.dll to the same place u run the msbuild.exe command OR update the path in the Scripts.xml file ..


        AssemblyFile="F:\Checkouts\Offerta\trunk\build\\packages\yahoo-pew-pew\Yahoo.Yui.Compressor.dll" />

do those ideas help you?

Sep 16, 2011 at 1:59 PM

1. I get the same result if I explicity set the path of the .dll

      AssemblyFile="F:\Checkouts\Offerta\trunk\build\\Yahoo.Yui.Compressor.dll" />

2. I'm running the same directory as the .xml file and the dlls:

F:\Checkouts\Offerta\trunk\build\>msbuild Scripts.xml
Microsoft (R) Build-motor version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.237]
Copyright (C) Microsoft Corporation 2007. Med ensamrätt.

Genereringen startade 2011-09-16 15:57:35.
Projektet F:\Checkouts\Offerta\trunk\build\\Scripts.xml på nod 1 (sta
F:\Checkouts\Offerta\trunk\build\\Scripts.xml(16,7): error MSB4062: D
et gick inte att läsa in CompressorTask-aktiviteten från sammansättningen F:\Ch
eckouts\Offerta\trunk\build\\Yahoo.Yui.Compressor.dll.  Kontrollera a
tt <UsingTask>-deklarationen är korrekt och att sammansättningen och alla dess
beroenden är tillgängliga samt att aktiviteten innehåller en offentlig klass so
m implementerar Microsoft.Build.Framework.ITask.
Projektgenereringen av F:\Checkouts\Offerta\trunk\build\\Scripts.xml
(standardmål) misslyckades.

(Sorry msbuild error is in swedish)

Sep 17, 2011 at 4:30 AM

@Nielsbosma : please read this discussion. I've posted a solution and steps, within it. 

Tell me if u have it working again, please :)

Sep 19, 2011 at 8:27 AM
Worked a lot better :)

2011/9/17 purekrome <>:
> From: purekrome
> @Nielsbosma : please read this discussion. I've posted a solution and steps,
> within it.
> Tell me if u have it working again, please :)
> Read the full discussion online.
> To add a post to this discussion, reply to this email
> ([email removed])
> To start a new discussion for this project, email
> [email removed]
> You are receiving this email because you subscribed to this discussion on
> CodePlex. You can unsubscribe on
> Please note: Images and attachments will be removed from emails. Any posts
> to this discussion will also be available online at