Packer for .NET
It was great to see that Scott Hanselman has placed Packer for .NET on his annual list.
What is it?
Packer for .NET also supports a mode to use JSMin. It uses a different process which simply strips comments and whitespace from the source scripts. In the cases where the Packer mode is unable to transform a script it may be possible to use JSMin instead.
Packer versus JSMin?
You can now shrink your CSS Files with the new CSSMin mode. You simply select this new mode and your comments will be stripped and various optimizations will be run on your stylesheets. More Info
One new mode added in version 4.1 is Combine which simply appends each of the specified files into a single file. This can be useful if you wish to take all of your stylesheets and combine them into one for use in a Production environment after using them as separate files which are easier to maintain with multiple developers during development.
Usage: Packer [-?|-h] [-o <filename>] [-m <packer | jsmin | cssmin | combine>] <file1> <file2> ... Options: -h or -? Help -o <filename> Output Filename -m <packer | jsmin> Mode
The UpdateWebConfig task is new in version 4.1. It is a simpler option than the XmlUpdate task which is a part of the MSBuild Community Tasks. Instead of providing an XPath value to map out replacements, this UpdateWebConfig task makes it easy to replace commonly updated values during deployment, like the connection string !configSource, customer errors mode, debug mode, mail host and application settings. Not having to set the XPath for XmlUpdate show make your MSBuild script easier to read and maintain.
The UpdateWebConfig task is designed to run after a build has completed and is being prepared for deployment. The assembly is very small and can easily be included with your deployment files to carry out the UpdateWebConfig task at various points in your deployment. It is also not necessary to install Packer for .NET to use the UpdateWebConfig or even the Packer task. Refer to the test script for an example of the UsingTask directive.
For the UpdateWebConfig task the WebConfigPath must point to a valid Web.config file used with ASP.NET. And optionally the OutputPath can be set. If it is not set the output will be written to the WebConfigPath.
Also see test.proj for a working example.
Packer was originally ported to C# by Jessie Hansen. (See Packer Goes .NET)
JSMin was created by Douglas Crockford. (www.crockford.com)
CSSMin was originally written in Java by Isaac Schlueter. Then it was ported to C# by Daniel Crenna. New css tests and regexes were added by Michael Ash. Finally are additional cleaned up, commenting and refactoring by Chris Lienert it was incorporated into this project.