Quantcast
Channel: Yahoo! UI Library: YUI Compressor for .Net
Viewing all 275 articles
Browse latest View live

Commented Issue: Updated to latest YUI.Compressor and getting failures [10869]

$
0
0
I tried updating from Yahoo.YUI.COmpressort.dll (1.2.2.0) to the latest version of Yahoo.YUI.Compressor.NET (2.2.0.0), including the EMCA and Iesi.Collections dependencies, and I'm getting the following error:

errorMSB4062: The "CompressorTask" task could not be loaded from the assembly C:\inetpub\wwwroot\Build\Tools\..\Libraries\SharedAssemblies\Yahoo.Yui.Compressor.dll. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Note: I copied these files over the old ones in the same directory, refreshed code, and verified my msbuild file still had the correct references. I've tried several variations of configurations, the most simple of which is below.

```
<UsingTask TaskName="CompressorTask" AssemblyFile="..\Libraries\SharedAssemblies\YUI\Yahoo.Yui.Compressor.Build.MsBuild.dll" />
<Target Name="AfterBuild">

<ItemGroup>
<HomesCss Include="$(ReleasePath)\homes\styles\CalendarPopupStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\CalendarStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\ComboBoxStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\GridStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\MainMenuStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\MainStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\NavigationStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\TabStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\WebPartStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\FullCalendar.css" />
</ItemGroup>

<CompressorTask SourceFiles="@(HomesCss)"
OutputFile="$(ReleasePath)\homes\styles\Site.css" />

<ItemGroup>
<MobileiPhoneCss Include="$(ReleasePath)\mobile\styles\iPhone2.css" />
</ItemGroup>
<CompressorTask SourceFiles="@(MobileiPhoneCss)"
OutputFile="$(ReleasePath)\mobile\styles\iPhone2.css"/>

<ItemGroup>
<PartnerDesktopCss Include="$(ReleasePath)\partner\styles\Desktop.css" />
</ItemGroup>
<CompressorTask SourceFiles="@(PartnerDesktopCss)"
OutputFile="$(ReleasePath)\partner\styles\Desktop.css" />
```

I'm guessing that something is changed with the newer file and I don't have my configurations set correctly.

Any help would be greatly appreciated.

Thanks,
Comments: ** Comment from web user: zambodi **

@purekrome:

1. Path location running from: From: C:\inetpub\wwwroot\Build\Tools\
2. Command: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe AppsDeploy.msbuild /p:Configuration=Release
3. C:\inetpub\wwwroot\Build\Libraries\SharedAssemblies\YUI\Yahoo.Yui.Compressor.Build.MsBuild.dll

@freeranger:
I've uploaded a PNG of the instructions to which you pointed. It looks like the "name" of the task is "CompressorTask". It looks to me that I have it configured exactly like the documentation. Can you point out what I'm missing in comparison to the uploaded image.. I'm missing it.

Thanks,


Commented Issue: Updated to latest YUI.Compressor and getting failures [10869]

$
0
0
I tried updating from Yahoo.YUI.COmpressort.dll (1.2.2.0) to the latest version of Yahoo.YUI.Compressor.NET (2.2.0.0), including the EMCA and Iesi.Collections dependencies, and I'm getting the following error:

errorMSB4062: The "CompressorTask" task could not be loaded from the assembly C:\inetpub\wwwroot\Build\Tools\..\Libraries\SharedAssemblies\Yahoo.Yui.Compressor.dll. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Note: I copied these files over the old ones in the same directory, refreshed code, and verified my msbuild file still had the correct references. I've tried several variations of configurations, the most simple of which is below.

```
<UsingTask TaskName="CompressorTask" AssemblyFile="..\Libraries\SharedAssemblies\YUI\Yahoo.Yui.Compressor.Build.MsBuild.dll" />
<Target Name="AfterBuild">

<ItemGroup>
<HomesCss Include="$(ReleasePath)\homes\styles\CalendarPopupStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\CalendarStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\ComboBoxStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\GridStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\MainMenuStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\MainStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\NavigationStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\TabStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\WebPartStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\FullCalendar.css" />
</ItemGroup>

<CompressorTask SourceFiles="@(HomesCss)"
OutputFile="$(ReleasePath)\homes\styles\Site.css" />

<ItemGroup>
<MobileiPhoneCss Include="$(ReleasePath)\mobile\styles\iPhone2.css" />
</ItemGroup>
<CompressorTask SourceFiles="@(MobileiPhoneCss)"
OutputFile="$(ReleasePath)\mobile\styles\iPhone2.css"/>

<ItemGroup>
<PartnerDesktopCss Include="$(ReleasePath)\partner\styles\Desktop.css" />
</ItemGroup>
<CompressorTask SourceFiles="@(PartnerDesktopCss)"
OutputFile="$(ReleasePath)\partner\styles\Desktop.css" />
```

I'm guessing that something is changed with the newer file and I don't have my configurations set correctly.

Any help would be greatly appreciated.

Thanks,
Comments: ** Comment from web user: zambodi **

I removed the complexity of paths and other msbuild activities from my file and run again. This is my exact message:

C:\inetpub\wwwroot\Tools>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild
.exe Test.msbuild /p:Configuration=Debug
Microsoft (R) Build Engine version 4.0.30319.17929
[Microsoft .NET Framework, version 4.0.30319.18034]
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 3/13/2013 9:34:33 AM.
Project "C:\inetpub\wwwroot\Tools\Test.msbuild" on node 1 (default targets).
C:\inetpub\wwwroot\Tools\Test.msbuild(20,5): error MSB4062: The "CompressorTask
" task could not be loaded from the assembly C:\inetpub\wwwroot\Libraries\Share
dAssemblies\YUI\Yahoo.Yui.Compressor.Build.MsBuild.dll. Confirm that the <Usin
gTask> declaration is correct, that the assembly and all its dependencies are a
vailable, and that the task contains a public class that implements Microsoft.B
uild.Framework.ITask.
Done Building Project "C:\inetpub\wwwroot\Tools\Test.msbuild" (default targets)
-- FAILED.


Build FAILED.

"C:\inetpub\wwwroot\Tools\Test.msbuild" (default target) (1) ->
(AfterBuild target) ->
C:\inetpub\wwwroot\Tools\Test.msbuild(20,5): error MSB4062: The "CompressorTa
sk" task could not be loaded from the assembly C:\inetpub\wwwroot\Libraries\Sha
redAssemblies\YUI\Yahoo.Yui.Compressor.Build.MsBuild.dll. Confirm that the <Us
ingTask> declaration is correct, that the assembly and all its dependencies are
available, and that the task contains a public class that implements Microsoft
.Build.Framework.ITask.

0 Warning(s)
1 Error(s)

Time Elapsed 00:00:00.03

C:\inetpub\wwwroot\Tools>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild
.exe Test.msbuild /p:Configuration=Debug

Commented Issue: Updated to latest YUI.Compressor and getting failures [10869]

$
0
0
I tried updating from Yahoo.YUI.COmpressort.dll (1.2.2.0) to the latest version of Yahoo.YUI.Compressor.NET (2.2.0.0), including the EMCA and Iesi.Collections dependencies, and I'm getting the following error:

errorMSB4062: The "CompressorTask" task could not be loaded from the assembly C:\inetpub\wwwroot\Build\Tools\..\Libraries\SharedAssemblies\Yahoo.Yui.Compressor.dll. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Note: I copied these files over the old ones in the same directory, refreshed code, and verified my msbuild file still had the correct references. I've tried several variations of configurations, the most simple of which is below.

```
<UsingTask TaskName="CompressorTask" AssemblyFile="..\Libraries\SharedAssemblies\YUI\Yahoo.Yui.Compressor.Build.MsBuild.dll" />
<Target Name="AfterBuild">

<ItemGroup>
<HomesCss Include="$(ReleasePath)\homes\styles\CalendarPopupStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\CalendarStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\ComboBoxStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\GridStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\MainMenuStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\MainStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\NavigationStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\TabStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\WebPartStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\FullCalendar.css" />
</ItemGroup>

<CompressorTask SourceFiles="@(HomesCss)"
OutputFile="$(ReleasePath)\homes\styles\Site.css" />

<ItemGroup>
<MobileiPhoneCss Include="$(ReleasePath)\mobile\styles\iPhone2.css" />
</ItemGroup>
<CompressorTask SourceFiles="@(MobileiPhoneCss)"
OutputFile="$(ReleasePath)\mobile\styles\iPhone2.css"/>

<ItemGroup>
<PartnerDesktopCss Include="$(ReleasePath)\partner\styles\Desktop.css" />
</ItemGroup>
<CompressorTask SourceFiles="@(PartnerDesktopCss)"
OutputFile="$(ReleasePath)\partner\styles\Desktop.css" />
```

I'm guessing that something is changed with the newer file and I don't have my configurations set correctly.

Any help would be greatly appreciated.

Thanks,
Comments: ** Comment from web user: purekrome **

Have a look at this sample msbuild.prj file: http://yuicompressor.codeplex.com/SourceControl/changeset/view/82550#1331074

notice the top is like this:

```
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/MsBuild/2003">

<UsingTask TaskName="CssCompressorTask" AssemblyFile="..\..\lib\NET20\Yahoo.Yui.Compressor.Build.MsBuild.dll" />
<UsingTask TaskName="JavaScriptCompressorTask" AssemblyFile="..\..\lib\NET20\Yahoo.Yui.Compressor.Build.MsBuild.dll" />


```

where we have a different name for the TaskName.

can you refer to that doc and try some more stuff?

Commented Issue: Updated to latest YUI.Compressor and getting failures [10869]

$
0
0
I tried updating from Yahoo.YUI.COmpressort.dll (1.2.2.0) to the latest version of Yahoo.YUI.Compressor.NET (2.2.0.0), including the EMCA and Iesi.Collections dependencies, and I'm getting the following error:

errorMSB4062: The "CompressorTask" task could not be loaded from the assembly C:\inetpub\wwwroot\Build\Tools\..\Libraries\SharedAssemblies\Yahoo.Yui.Compressor.dll. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Note: I copied these files over the old ones in the same directory, refreshed code, and verified my msbuild file still had the correct references. I've tried several variations of configurations, the most simple of which is below.

```
<UsingTask TaskName="CompressorTask" AssemblyFile="..\Libraries\SharedAssemblies\YUI\Yahoo.Yui.Compressor.Build.MsBuild.dll" />
<Target Name="AfterBuild">

<ItemGroup>
<HomesCss Include="$(ReleasePath)\homes\styles\CalendarPopupStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\CalendarStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\ComboBoxStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\GridStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\MainMenuStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\MainStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\NavigationStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\TabStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\WebPartStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\FullCalendar.css" />
</ItemGroup>

<CompressorTask SourceFiles="@(HomesCss)"
OutputFile="$(ReleasePath)\homes\styles\Site.css" />

<ItemGroup>
<MobileiPhoneCss Include="$(ReleasePath)\mobile\styles\iPhone2.css" />
</ItemGroup>
<CompressorTask SourceFiles="@(MobileiPhoneCss)"
OutputFile="$(ReleasePath)\mobile\styles\iPhone2.css"/>

<ItemGroup>
<PartnerDesktopCss Include="$(ReleasePath)\partner\styles\Desktop.css" />
</ItemGroup>
<CompressorTask SourceFiles="@(PartnerDesktopCss)"
OutputFile="$(ReleasePath)\partner\styles\Desktop.css" />
```

I'm guessing that something is changed with the newer file and I don't have my configurations set correctly.

Any help would be greatly appreciated.

Thanks,
Comments: ** Comment from web user: freeranger **

Hi,

You are using a task called "CompressorTask" which, as I said, does not exist any more.
As per the area you highlighted in the image you uploaded, the name of the task is "CssCompressorTask" for css files or ("JavaScriptCompressorTask" for the javascript compressor).

Please use CssCompressorTask and change any property names that have changed also, per the documentation, and you should be good to go.

hth

Commented Issue: Updated to latest YUI.Compressor and getting failures [10869]

$
0
0
I tried updating from Yahoo.YUI.COmpressort.dll (1.2.2.0) to the latest version of Yahoo.YUI.Compressor.NET (2.2.0.0), including the EMCA and Iesi.Collections dependencies, and I'm getting the following error:

errorMSB4062: The "CompressorTask" task could not be loaded from the assembly C:\inetpub\wwwroot\Build\Tools\..\Libraries\SharedAssemblies\Yahoo.Yui.Compressor.dll. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Note: I copied these files over the old ones in the same directory, refreshed code, and verified my msbuild file still had the correct references. I've tried several variations of configurations, the most simple of which is below.

```
<UsingTask TaskName="CompressorTask" AssemblyFile="..\Libraries\SharedAssemblies\YUI\Yahoo.Yui.Compressor.Build.MsBuild.dll" />
<Target Name="AfterBuild">

<ItemGroup>
<HomesCss Include="$(ReleasePath)\homes\styles\CalendarPopupStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\CalendarStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\ComboBoxStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\GridStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\MainMenuStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\MainStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\NavigationStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\TabStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\WebPartStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\FullCalendar.css" />
</ItemGroup>

<CompressorTask SourceFiles="@(HomesCss)"
OutputFile="$(ReleasePath)\homes\styles\Site.css" />

<ItemGroup>
<MobileiPhoneCss Include="$(ReleasePath)\mobile\styles\iPhone2.css" />
</ItemGroup>
<CompressorTask SourceFiles="@(MobileiPhoneCss)"
OutputFile="$(ReleasePath)\mobile\styles\iPhone2.css"/>

<ItemGroup>
<PartnerDesktopCss Include="$(ReleasePath)\partner\styles\Desktop.css" />
</ItemGroup>
<CompressorTask SourceFiles="@(PartnerDesktopCss)"
OutputFile="$(ReleasePath)\partner\styles\Desktop.css" />
```

I'm guessing that something is changed with the newer file and I don't have my configurations set correctly.

Any help would be greatly appreciated.

Thanks,
Comments: ** Comment from web user: zambodi **

Ah.. I was thinking the name was dynamic. It's already working! Thanks and sorry for the confusion.

Commented Issue: Updated to latest YUI.Compressor and getting failures [10869]

$
0
0
I tried updating from Yahoo.YUI.COmpressort.dll (1.2.2.0) to the latest version of Yahoo.YUI.Compressor.NET (2.2.0.0), including the EMCA and Iesi.Collections dependencies, and I'm getting the following error:

errorMSB4062: The "CompressorTask" task could not be loaded from the assembly C:\inetpub\wwwroot\Build\Tools\..\Libraries\SharedAssemblies\Yahoo.Yui.Compressor.dll. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Note: I copied these files over the old ones in the same directory, refreshed code, and verified my msbuild file still had the correct references. I've tried several variations of configurations, the most simple of which is below.

```
<UsingTask TaskName="CompressorTask" AssemblyFile="..\Libraries\SharedAssemblies\YUI\Yahoo.Yui.Compressor.Build.MsBuild.dll" />
<Target Name="AfterBuild">

<ItemGroup>
<HomesCss Include="$(ReleasePath)\homes\styles\CalendarPopupStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\CalendarStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\ComboBoxStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\GridStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\MainMenuStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\MainStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\NavigationStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\TabStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\WebPartStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\FullCalendar.css" />
</ItemGroup>

<CompressorTask SourceFiles="@(HomesCss)"
OutputFile="$(ReleasePath)\homes\styles\Site.css" />

<ItemGroup>
<MobileiPhoneCss Include="$(ReleasePath)\mobile\styles\iPhone2.css" />
</ItemGroup>
<CompressorTask SourceFiles="@(MobileiPhoneCss)"
OutputFile="$(ReleasePath)\mobile\styles\iPhone2.css"/>

<ItemGroup>
<PartnerDesktopCss Include="$(ReleasePath)\partner\styles\Desktop.css" />
</ItemGroup>
<CompressorTask SourceFiles="@(PartnerDesktopCss)"
OutputFile="$(ReleasePath)\partner\styles\Desktop.css" />
```

I'm guessing that something is changed with the newer file and I don't have my configurations set correctly.

Any help would be greatly appreciated.

Thanks,
Comments: ** Comment from web user: freeranger **

Glad we could help!

Closed Issue: Updated to latest YUI.Compressor and getting failures [10869]

$
0
0
I tried updating from Yahoo.YUI.COmpressort.dll (1.2.2.0) to the latest version of Yahoo.YUI.Compressor.NET (2.2.0.0), including the EMCA and Iesi.Collections dependencies, and I'm getting the following error:

errorMSB4062: The "CompressorTask" task could not be loaded from the assembly C:\inetpub\wwwroot\Build\Tools\..\Libraries\SharedAssemblies\Yahoo.Yui.Compressor.dll. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Note: I copied these files over the old ones in the same directory, refreshed code, and verified my msbuild file still had the correct references. I've tried several variations of configurations, the most simple of which is below.

```
<UsingTask TaskName="CompressorTask" AssemblyFile="..\Libraries\SharedAssemblies\YUI\Yahoo.Yui.Compressor.Build.MsBuild.dll" />
<Target Name="AfterBuild">

<ItemGroup>
<HomesCss Include="$(ReleasePath)\homes\styles\CalendarPopupStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\CalendarStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\ComboBoxStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\GridStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\MainMenuStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\MainStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\NavigationStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\TabStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\WebPartStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\FullCalendar.css" />
</ItemGroup>

<CompressorTask SourceFiles="@(HomesCss)"
OutputFile="$(ReleasePath)\homes\styles\Site.css" />

<ItemGroup>
<MobileiPhoneCss Include="$(ReleasePath)\mobile\styles\iPhone2.css" />
</ItemGroup>
<CompressorTask SourceFiles="@(MobileiPhoneCss)"
OutputFile="$(ReleasePath)\mobile\styles\iPhone2.css"/>

<ItemGroup>
<PartnerDesktopCss Include="$(ReleasePath)\partner\styles\Desktop.css" />
</ItemGroup>
<CompressorTask SourceFiles="@(PartnerDesktopCss)"
OutputFile="$(ReleasePath)\partner\styles\Desktop.css" />
```

I'm guessing that something is changed with the newer file and I don't have my configurations set correctly.

Any help would be greatly appreciated.

Thanks,

Closed Issue: Javascript compressor problem (missing formal parameter) [10547]

$
0
0
Hi,



I have been using your library for some time and it works great. However I just got a problem today when trying to compress the Opentip.js library (http://www.opentip.org/). I isolated the problem to this code:

function abc(string) {
string.replace(/([A-Z])/g, function(_, char) {
return "-" + (char.toLowerCase());
});
};

I get this error: "missing formal parameter". I updated to the latest version and I still have the error.
Having a function as the second parameter is valid according to the Mozilla documentation (https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/replace).

Is there a way to fix / ignore the error?

Thanks!

Commented Issue: Updated to latest YUI.Compressor and getting failures [10869]

$
0
0
I tried updating from Yahoo.YUI.COmpressort.dll (1.2.2.0) to the latest version of Yahoo.YUI.Compressor.NET (2.2.0.0), including the EMCA and Iesi.Collections dependencies, and I'm getting the following error:

errorMSB4062: The "CompressorTask" task could not be loaded from the assembly C:\inetpub\wwwroot\Build\Tools\..\Libraries\SharedAssemblies\Yahoo.Yui.Compressor.dll. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Note: I copied these files over the old ones in the same directory, refreshed code, and verified my msbuild file still had the correct references. I've tried several variations of configurations, the most simple of which is below.

```
<UsingTask TaskName="CompressorTask" AssemblyFile="..\Libraries\SharedAssemblies\YUI\Yahoo.Yui.Compressor.Build.MsBuild.dll" />
<Target Name="AfterBuild">

<ItemGroup>
<HomesCss Include="$(ReleasePath)\homes\styles\CalendarPopupStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\CalendarStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\ComboBoxStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\GridStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\MainMenuStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\MainStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\NavigationStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\TabStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\WebPartStyles.css" />
<HomesCss Include="$(ReleasePath)\homes\styles\FullCalendar.css" />
</ItemGroup>

<CompressorTask SourceFiles="@(HomesCss)"
OutputFile="$(ReleasePath)\homes\styles\Site.css" />

<ItemGroup>
<MobileiPhoneCss Include="$(ReleasePath)\mobile\styles\iPhone2.css" />
</ItemGroup>
<CompressorTask SourceFiles="@(MobileiPhoneCss)"
OutputFile="$(ReleasePath)\mobile\styles\iPhone2.css"/>

<ItemGroup>
<PartnerDesktopCss Include="$(ReleasePath)\partner\styles\Desktop.css" />
</ItemGroup>
<CompressorTask SourceFiles="@(PartnerDesktopCss)"
OutputFile="$(ReleasePath)\partner\styles\Desktop.css" />
```

I'm guessing that something is changed with the newer file and I don't have my configurations set correctly.

Any help would be greatly appreciated.

Thanks,
Comments: ** Comment from web user: purekrome **

group hi-5!

Updated Wiki: Home

$
0
0

Project Description
This is a .NET port of the Yahoo! UI Library's YUI Compressor Java project. The objective of this project is to compress any Javascript and Cascading Style Sheets to an efficient level that works exactly as the original source, before it was minified.

Available via NuGet
NuGet Command

NuGet Command with MSBuild Task

NuGet Command with NAnt Task

NuGet Command with Web Optimization

 
Main Features

  • Compress and/or Bundle Javascript and/or Cascading StyleSheets.
  • 1 source file -> 1 destination file (that's just compression)
  • Multiple source files -> 1 destination file (compression and bundling)
  • Multiple source files -> multiple destination files (so you're pro at this now?!)
  • Optional MSBuild Tasks, NAnt Tasks and MVC4 BundleTransform.


Referenced Version
Based on YUI Compressor version: 2.4.4 (last checked at 2011-01-17).

How close to the Java Port?
Pretty damn close, now :) Same unit tests (which pass).
The only thing I haven't been able to do is get the exact same obfuscation becausethe java code is using a hashtable instead of a sorted hashtable/dictionary. It's identical besides that (and works the same). Just visually look different but is exactly the same file size, etc.

Video Tutorials

Using YUI Compressor .NET (Core)

Using YUI Compressor .NET (Core)

Using YUI Compressor .NET (MSBuild)

Using YUI Compressor .NET (MSBuild)

Using YUI Compressor .NET (Web Optimization)

(Older video) Using YUI Compressor .NET 1.7 with MSBuild

(Older video) Using YUI Compressor .NET 1.7 with MSBuild


Sample MsBuild output




Who's utilising this code/library?
If you use this code in some project, please drop us a message so we can include it in this list :)



References
YUI Compressor home page: http://developer.yahoo.com/yui/compressor/

Thank You's!
We couldn't have made this project without the support of the following software:

The best C# refactoring plugin for Visual Studio



Please support them buy trying their software. If you like it (like we do!) then purchase it. Thank you :)

Reviewed: Version 2.2.0.0 - Epee (Apr 04, 2013)

$
0
0
Rated 5 Stars (out of 5) - Thank-you. Lau

New Post: Advice for integrating YUI .NET into a ASP.NET Web App

$
0
0
Hi,

I am considering using this library within a .NET 4.0 ASP.NET Web forms App. None of the sample videos cover this specifically. So I've a few questions on this...
  • Can this package actually be integrated into a Web Forms web app instead of MVC App?
  • Are there any resources that can show me how to do this via either MsBuild or some other manner?
  • Apart from css/js within the web app I have server-side webcontrols that have css/js included with them as webResource files. I am considering removing the embedded resources and moving the css/js into the web app so that they would be processed by YUI. Would you consider this a good idea or is there a way for YUI .NET to handle the embedded resouces?
Thanks

Andy

New Post: Advice for integrating YUI .NET into a ASP.NET Web App

$
0
0
Hi Andy,

it's been years since I've touched WebForms (all MVC myself). I believe it can be used in a Web forms app because there's no MVC specific stuff at all.

1) and 2)

I've made a a video about to use MSBuild to leverage the compressor. Yes, the video is using an MVC project but that's irrelevant because it's using NOTHING MVC-special. U can copy the entire video and substitute the 1 sec in it where i do FILE=>NEW=>MVC with FILE=>NEW=>WebForms.

all the rest is the same.


3) Embedded resources .. hmm. never thought of that. If you're going to embedd the css/js, you can always manually minify the content and then just stick that result into the web resource? It's a PITA but a possible solution. Other than that, i would keep that content separate as u suggested.

GL!

New Post: Advice for integrating YUI .NET into a ASP.NET Web App

$
0
0
Hi GL,

Thanks for the reply. I had previously watched all your short clips (very informative) but just wanted to be sure that it was possible to integrate with Web forms.
I think I will seperate the CSS/JS with regards to the embedded resources as the DLLs are not used outside of the web app and so the need for embedding is removed.

Thanks!

Andy

New Post: Advice for integrating YUI .NET into a ASP.NET Web App

$
0
0
Hi Andy,

Agree with PK on 1 & 2.
As well as the msbuild video, if you go to the Source Code tab and navigate to Documentation/Post-build Events WebSite Example, this is an MVC project which uses msbuild and compresses your files when in Release mode. If you download and run the project, one of the pages on the site will discuss it in some detail.

re: Embedded resources - I thought about this before, replacing the resources post-build with minified versions, but you can't rewrite them in the assembly, so I abandoned that idea. Recently however, I have come up with another idea....though it is untested as yet so may need a tweak:

Lets say you have a file called myjs.js which is currently an embedded resource. Do the following:
  • Change it's build action to None
  • Create a copy of it called myjs.min.js and set the build action on that to be Embedded Resource
  • Whereever you would have referred to myjs.js, you need to replace with references to myjs.min.js
  • Create a pre build event (similar to the post build events example I mentioned earlier) which will, in Debug mode, just copy myjs.js as myjs.min.js (to ensure you always have the latest version) but in Release mode will minify myjs.js to myjs.min.js
The end result should be your embedded minified (or no minified) resource file.

hth!

Reviewed: Version 2.2.0.0 - Epee (Apr 17, 2013)

$
0
0
Rated 3 Stars (out of 5) - The 2.2.1.0 msbuild dll classes don't appear to implement Microsoft.Build.Utilities.Task.CompressorTask I had to revert to 2.1.1.0 to get the msbuild compressor going again.

New Post: Ordering javascript imports

$
0
0
Hi -

I'm trying to get the compressor set up for my project. We have what can only be described as a buttload of our own and library javascript files which I'd like to concatenate and minify at build time.

The problem I'm having is working out how the order of concatenation is controlled: I need to import my libraries in the correct order so that each file's dependencies are satisfied when its loaded and executed.

Ideally what I'd like is something that looked a bit like:

import file #1
import file #2
...
import all other files in scripts directory in any order.

but if I have to list all the files, that'd be ok.

I've tried
<JavaScriptFiles Include="($WebProjectOutputDir)/Scripts/file1.js;
($WebProjectOutputDir)/Scripts/file2.js;"/>

      <JavaScriptFiles Include="$(WebProjectOutputDir)\Scripts\*.js" 
      Exclude="@(JavascriptFiles)"/>
    </ItemGroup>
but it doesn't look like my intended ordering is respected.

Is there a way to do what I want to do?

New Post: Ordering javascript imports

$
0
0
Hi,

You are falling foul of msbuild - it always orders them alphabetically.
One of the answers here http://stackoverflow.com/questions/7050552/msbuild-item-order-when-using-wildcards links to a custom msbuild task that may help

Other options are:
  • name your files such that the ones you want first appear first in the alphabet
  • Compress each file you want first individually and then lump all the others together - you end up with a few more round trips than you'd like but you still get the benefit of compression.
  • Alter the scripts such that load order isn't important - it seems to me a bit brittle
Sorry there's no one easy answer to this one, but blame MSBuild for it :)

New Post: Ordering javascript imports

$
0
0
It's only the wildcard search that is ordered alphabetically, msbuild actually guarantees the order is maintained, see here: http://stackoverflow.com/questions/1219859/do-items-in-msbuild-file-maintain-their-order-when-passed-to-a-task .

The reason my code wasn't working was just because I had the $ and the ( the wrong way round, so file1.js and file2.js were being read in in the directory search, rather than being added at the start.

This version:
<JavaScriptFiles Include="$(WebProjectOutputDir)/Scripts/file1.js"/>
 <JavaScriptFiles Include="$(WebProjectOutputDir)/Scripts/file2.js"/>

      <JavaScriptFiles Include="$(WebProjectOutputDir)\Scripts\*.js" 
      Exclude="@(JavascriptFiles)"/>
    </ItemGroup>
will do what I wanted.

New Post: Ordering javascript imports

$
0
0
Lol, I didn't spot that either :) Glad you're up and running now anyway...
Viewing all 275 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>