Dave Burke : Freelance .NET Web Developer specializing in Online Communities

ASP.NET Ajax and Community Server: JavaScript Comment Stripper Task not found

 

I bumped into this error when I tried to do a Release Mode compile of the Ajax Control Toolkit project in my Community Server solution.  The "JavaScriptCommentStripperTask" task was not found, yet I was referencing the JavaScriptCommentStripperTask.DLL in my Toolkit project

Here's the complete compilation error:


Error 2 The "JavaScriptCommentStripperTask" 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 interface. 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. C:\dbvt\CS2007\source\AjaxControlToolkit\AjaxControlToolkit.csproj 268 5 AjaxControlToolkit

I found the fix in a comment by Chris Field on a ScottGu post.  Any .JS files which are to be stripped of comments have to be listed in the Ajax Control Toolkit project's .PROJ file.  I was using a customized version of the Toolkit SlideShow control so added that .JS file as a <JavaScriptCommentStripperTask /> item.

<UsingTask TaskName="AjaxControlToolkit.JavaScriptCommentStripperTask"
   AssemblyFile="$(MSBuildProjectDirectory)\..\Binaries\JavaScriptCommentStripper.dll" />
     <Target Name="AfterBuild">
         <JavaScriptCommentStripperTask SourceFiles="$(MSBuildProjectDirectory
               \obj\Release\AjaxControlToolkit.SlideShow.SlideShowBehavior.js"
               DestinationFiles="$(MSBuildProjectDirectory)\obj\Release\AjaxControlToolkit.SlideShow.SlideShowBehavior.js">
          </JavaScriptCommentStripperTask>
      </Target>
....

Comments (0) | Post RSS RSS comment feed

Posted on 5/29/2007 7:02:00 PM by Dave Burke
Categories: .NET | Community Server
Tags:

Related posts


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke