Ajax minifier and Visual Studio 2008 with 3.5?

Dec 12, 2012 at 9:43 AM

I downloaded the latest AjaxMinifier (4.78) but it appears to only work for .Net 4?

Changing my project to target 4 isn't an option at this point.

Can anyone point me to a download that will work with 3.5 or a solution to this problem?

I noticed that my ToolsVersion="3.5" but i tried "4.0" and it didn't make any difference?

The error for reference that i get on build is:

error MSB4062: The "AjaxMin" task could not be loaded from the assembly C:\Program Files\MSBuild\Microsoft\MicrosoftAjax\AjaxMinTask.dll. Could not load file or assembly 'file:///C:\Program Files\MSBuild\Microsoft\MicrosoftAjax\AjaxMinTask.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available.

my project contains:

<Import Project="$(MSBuildExtensionsPath)\Microsoft\MicrosoftAjax\AjaxMin.tasks" />
  <Target Name="AfterBuild">
      <JS Include="**\*.js" Exclude="**\*.min.js;Scripts\*.js" />
      <CSS Include="**\*.css" Exclude="**\*.min.css" />
        JsSourceFiles="@(JS)"  JsSourceExtensionPattern="\.js$" JsTargetExtension=".min.js"
       CssSourceFiles="@(CSS)" CssSourceExtensionPattern="\.css$" CssTargetExtension=".min.css"  />

Dec 12, 2012 at 4:16 PM

Correct. The MSI-distributed binaries are for the .NET 4.0 framework. I also build the task for 3.5, and the EXE and DLL for 2.0 and 3.5, I just don't include them in the MSI. The nuget package has the 2.0 and 3.5 versions of the AjaxMin.dll, but not the task. I can send you the .NET3.5 version of the task now, and I'll add it to the nuget package for next time so you can continue to pull newer version as they become available.

Dec 19, 2012 at 4:16 PM

I download the last version from Nuget (4.78), but i need the task (and EXE) for 3.5 version.

Can you send me this package, please?

Thanks you


Dec 19, 2012 at 5:03 PM

I can't seem to send a ZIP file to the discussion thread. Let me see what my options are here.

Jan 29, 2013 at 6:10 PM
Edited Jan 29, 2013 at 6:10 PM

I am having the same exact issue. I have a project in VS2008 and .NET 3.5. All I need is the 3.5 version of AjaxMin.dll but it appears NuGet only works with VS2010.

Apr 23, 2013 at 11:14 AM
I fixed this problem using the old AjaxMinSetup-4.19.msi that works with 3.5, see:
May 8, 2013 at 12:10 AM
Starting with version 4.91, the .NET 3.5 DLLs (AjaxMin.dll and AjaxMinTask.dll) are included in the NuGet package under the tools\net35 folder.