|
Hi Folks,
Ok - I got a working solution. First of all, (this is a bit embarrassing I forgot to update my docs to make sure people use the correct dll.
Too Long; Didn't Read (TL;DR)
1. Grab the latest version of YUICompressor WITH MSBUILD TASK from NuGet. I've -replaced- v1.6.0.1 with a new v 1.6.0.1. So uninstall v1.6.0.1 and then re-install it via nuget.
2. Update your xml build file to point to the correct dll
<UsingTask
TaskName="CompressorTask"
AssemblyFile="<root folder for your solution>\packages\YUICompressor.NET-MsBuild-Task.1.6.0.1\lib\NET35\Yahoo.Yui.Compressor.MsBuildTask.dll" />
Some history/context
Before build 1.6.0.1, the main dll had the MSBuild task inside the dll. This ment that the dll actually had a dependency on some MSBuild namespaces and references. Under some certain code conditions (they had to do with deep reflection upon
the dll) the applications crashed if those MSBuild requirements were not installed on the computer. In summary, the dll sometimes cause systems to crash under very very very unique scenarios. I happen to be afflicted by that scenario :)
So, I split the dll into two dll's.
Now, if you need to do something with MSBuild, then you need to get the NuGet package with MSBuild in it :

Now this new package used to contain a dependancy upon the core dll, but i just couldn't get my msbuild.xml file to work when the yuicompressor-core dll's are NOT in the same folder as the yuicompress-msbuild.dll. I thought there was a assembly reference
element or something, but I could figure it out.
So the crappy solution I've done is to put the yuicompressor-core dll's AND the new yuicompressor-msbuild dll into the same nuget pacakge. *sigh*
So .. that's the first thing.
Next, change your msbuild xml file to point to the yuicompressor-msbuild file, not the core file.
It should now read like this..
<UsingTask
TaskName="CompressorTask"
AssemblyFile="<root folder for your solution>\packages\YUICompressor.NET-MsBuild-Task.1.6.0.1\lib\NET35\Yahoo.Yui.Compressor.MsBuildTask.dll"
/>
Of course, you need to put the correct path/location of the dll.
Tell me how this goes for you all.
|