I get modified css and js files but also one exception: exited with code 123

Nov 27, 2011 at 9:34 PM

I have a problem, the modified files are created as aspected but visualstudio throws exception. I guess I have missed something obvious here but I can´t find out what it is. Can you guys help me?

Here is my exception:

Error 3 The command "C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "C:\Dev\TestProj\MsBuild\MSBuildSettings.xml" /p:CssOutputFile="C:\Dev\TestProj\bin\styles.min.css" /p:JavaScriptOutputFile="C:\Dev\TestProj\bin\javascript.min.js"" exited with code 123. TestProj

 

In my Post-Build event command line, it looks like this:

$(MSBuildBinPath)\msbuild.exe "$(ProjectDir)MsBuild\MSBuildSettings.xml" /p:CssOutputFile="$(TargetDir)styles.min.css" /p:JavaScriptOutputFile="$(TargetDir)javascript.min.js"

Here is my MSBuildSettings.xml file:
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/MsBuild/2003">
    <UsingTask
        TaskName="CompressorTask"
        AssemblyFile="C:\Dev\TestProj\MSBuild\Yahoo.Yui.Compressor.MsBuildTask.dll" />

    <PropertyGroup>
        <CssOutputFile Condition=" '$(CssOutputFile)'=='' ">..\MSBuild\styles.min.css</CssOutputFile>
        <JavaScriptOutputFile Condition=" '$(JavaScriptOutputFile)'=='' ">..\MSBuild\javascript.min.js</JavaScriptOutputFile>
    </PropertyGroup>

    <Target Name="MyTaskTarget">
        <!--
            ItemGroup\CssFiles or ItemGroup\JavaScriptFiles: add zero to many files you wish to include in this compression task.
                                                             Don't forget, you can use the wildcard (eg. *.css, *.js) if you feel up to it.
                                                             Finally, at least one item is required - either a css file or a js file.
                                                             
            CssFiles/JavaScriptFiles data format: Please do not touch this.
            DeleteCssFiles: [Optional] True | Yes | Yeah | Yep | True | FoSho | Fo Sho. Default is False. Anything else is False. (eg. blah = false, xxxx111 = false, etc)
            CssCompressionType: YuiStockCompression | MichaelAshsRegexEnhancements | HaveMyCakeAndEatIt or BestOfBothWorlds or Hybrid; Default is YuiStockCompression.
            ObfuscateJavaScript: [Optional] refer to DeleteCssFiles, above.
            PreserveAllSemicolons: [Optional] refer to DeleteCssFiles, above.
            DisableOptimizations: [Optional] refer to DeleteCssFiles, above.
            EncodingType: [Optional] ASCII, BigEndianUnicode, Unicode, UTF32, UTF7, UTF8, Default. Default is 'Default'.
            DeleteJavaScriptFiles: [Optional] refer to DeleteCssFiles, above.
            LineBreakPosition: [Optional] the position where a line feed is appened when the next semicolon is reached. Default is -1 (never add a line break).
                               0 (zero) means add a line break after every semicolon. (This might help with debugging troublesome files).          
            LoggingType: None | ALittleBit | HardcoreBringItOn;  Hardcore also lists javascript verbose warnings, if there are any (and there usually is :P ).
            ThreadCulture: [Optional] the culture you want the thread to run under. Default is 'en-gb'.
            IsEvalIgnored: [Optional] compress any functions that contain 'eval'. Default is False, which means a function that contains
                           'eval' will NOT be compressed. It's deemed risky to compress a function containing 'eval'. That said,
                           if the usages are deemed safe this check can be disabled by setting this value to True.
        -->

        <ItemGroup>
            <CssFiles Include="$(ProjectDir)..\Styles\site.css" />
            <JavaScriptFiles Include="$(ProjectDir)..\Scripts\BlockUI.js"/>
        </ItemGroup>

        <CompressorTask
            CssFiles="@(CssFiles)"
            DeleteCssFiles="false"
            CssOutputFile="$(CssOutputFile)"
            CssCompressionType="YuiStockCompression"
            JavaScriptFiles="@(JavaScriptFiles)"
            ObfuscateJavaScript="True"
            PreserveAllSemicolons="False"
            DisableOptimizations="Nope"
            EncodingType="Default"
            DeleteJavaScriptFiles="false"
            LineBreakPosition="-1"
            JavaScriptOutputFile="$(JavaScriptOutputFile)"
            LoggingType="ALittleBit"
            ThreadCulture="sv-SE" />
    </Target>
</Project>

I use Yahoo.Yui.Compressor.MsBuildTask.dll and VS2010 Express.

What is wrong here?

Nov 27, 2011 at 9:53 PM

Gah, I find out the answer myself, instead of having three lines of text in post-event textarea you should have everything in one line.

Coordinator
Nov 27, 2011 at 10:47 PM

Yeah. otherwise VS thinks they are different commands.