1

I'm trying to use AjaxMin without installing it. From this link ( http://ajaxmin.codeplex.com/wikipage?title=AjaxMinTask ) I thought the UsingTask tag would let me do it, but I keep getting this error:

E:......csproj (487): The "AjaxMin" task could not be instantiated from "E:...\libraries\AjaxMinTask.dll". System.IO.FileNotFoundException: Could not load file or assembly 'AjaxMin, Version=4.79.4762.18504, Culture=neutral, PublicKeyToken=21ef50ce11b5d80f' or one of its dependencies. The system cannot find the file specified. File name: 'AjaxMin, Version=4.79.4762.18504, Culture=neutral, PublicKeyToken=21ef50ce11b5d80f' at Microsoft.Ajax.Minifier.Tasks.AjaxMin..ctor() WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. E:......Web.csproj (487): The "AjaxMin" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name.

I also tried this ( Could not load file or assembly App_Licenses ), but it still doesn't work. Any ideas?

Community
  • 1
  • 1
mike
  • 536
  • 1
  • 6
  • 16
  • Hey @mike. From reading that same wiki link it seems that you must have `AjaxMinTask.dll` in your project to be able to use `UsingTask`. Did you add a reference to `AjaxMinTask.dll` to you project? – Frank van Puffelen Jan 19 '13 at 09:14
  • I have AjaxMinTask.dll checked into my repository, and my project .csproj file contains a tag that references that location. I did not, however add the dll to my project's References. I don't think that's necessary...? – mike Jan 21 '13 at 13:28
  • Given the error message, I suggest adding a reference to the `AjaxMinTask.dll` to the project. – Frank van Puffelen Jan 21 '13 at 14:52
  • thanks for the suggestion, but that's a no-go. – mike Jan 21 '13 at 18:17
  • i should mention...i have done this on a machine that has AjaxMin installed and it works. we just don't want to install it on our build server, so we need to be able to run the AjaxMin task without having it installed. – mike Jan 21 '13 at 18:22

1 Answers1

2

fyi - adding the dll as a reference did not work. we ended up adding the AjaxMin dll and exes to the repository, creating a manifest.xml, then adding the following as a pre-build step:

"$(SolutionDir)\libraries\AjaxMin" -clobber -xml "$(ProjectDir)\AjaxMin\manifest.xml"

we also added the minified files to the repository so they are copied to the publish area. not the most elegant solution, but it works for our situation.

mike
  • 536
  • 1
  • 6
  • 16