Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6322475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:20:17+00:00 2026-05-24T16:20:17+00:00

I have been banging my head on a brick wall that seems to be

  • 0

I have been banging my head on a brick wall that seems to be easily worked around for everyone except me.

I want to setup css and js compression using a standard build on Team Foundation Server 2010. Below is what I’ve tried so far and failed. I am looking for a magic helping hand to guide me into setting this up the way professionals (SO is full of em) believe it should.

http://yuicompressor.codeplex.com/releases/view/46679 (dowload demo using post-build events)

This method looked promising as it did exactly as promised when you build your project in Visual Studio.

My msbuild Post-build command:

$(MSBuildBinPath)\msbuild.exe
“$(ProjectDir)MSBuild\MSBuildSettings.xml”
/p:CssOutputFile=”$(TargetDir)..\Content\StylesSheetFinal.css”
/p:JavaScriptOutputFile=”$(TargetDir)..\Scripts\JavaScriptFinal.js”

However when the build is run by TFS I get a lot of errors like these:

D:\Builds\3\CKB 2010_Build_CP\Sources\CKB
2010\My.Name.Space\MSBuild\MSBuildSettings.xml (61): Failed
to save the compressed text into the output file [D:\Builds\3\CKB
2010_Build_CP\Binaries..\Content\StylesSheetFinal.css]. Please check
the path/file name and make sure the file isn’t magically locked,
read-only, etc..

So clearly the problem is the syntax in the Post-build command that is wrong. But I can’t figure out how to make it work for both local and TSF builds.

Update 2011-08-17

As noted by Edward Thompson, I’ve tried adding a backslash to the path:

$(MSBuildBinPath)\msbuild.exe
“$(ProjectDir)MSBuild\MSBuildSettings.xml”
/p:CssOutputFile=”$(TargetDir)\..\Content\styles.min.css”
/p:JavaScriptOutputFile=”$(TargetDir)\..\Scripts\scripts.min.js”

And the result is this:

Failed to save the compressed text into the output file
[D:\Builds\3\CKB 2010_Build_CP\Binaries\\..\Content\styles.min.css].
Please check the path/file name and make sure the file isn’t magically
locked, read-only, etc..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:20:18+00:00Added an answer on May 24, 2026 at 4:20 pm

    The problem is the difference in values with which TFS and Visual Studio run the msbuild command.

    These are the steps I have taken to get proper YuiCompressor integration with Visual Studio 2010 and Team Foundation Server 2010.

    1. In your desired project add a folder named ‘MSBuild’

    2. In this folder you should extract the files you download from the YuiCompressor project on CodePlex
      enter image description here

    3. Set the properties of these files like this:
      enter image description here

    4. Now open the MSBuildSettings.xml file and edit it according to the scripts and css files you want to have compressed. I have uploaded mine on pastebin since pasting it here caused problems with the editor.

    5. Add the following postbuild event to your project. Note that the paths can differ for your environment.

      IF “$(BuildingInsideVisualStudio)”==”” $(MSBuildBinPath)\msbuild.exe
      “$(ProjectDir)MSBuild\MSBuildSettings.xml”
      /p:CssOutputFile=”$(TargetDir)_PublishedWebsites\$(ProjectName)\Content\styles.min.css”
      /p:JavaScriptOutputFile=”$(TargetDir)_PublishedWebsites\$(ProjectName)\Scripts\scripts.min.js”
      IF “$(BuildingInsideVisualStudio)”==”true”
      $(MSBuildBinPath)\msbuild.exe
      “$(ProjectDir)MSBuild\MSBuildSettings.xml”
      /p:CssOutputFile=”$(TargetDir)..\Content\styles.min.css”
      /p:JavaScriptOutputFile=”$(TargetDir)..\Scripts\scripts.min.js”

    6. Build the project and see if the files where created as expected.

    7. Perform a check-in and watch the tfs build create the compressed files for you.

    8. For debugging the tfs build, you’ll find the logs in the msbuild log which is linked inside the normal tfsbuild log.

    I hope this helps someone out there. I couldn’t find a decent guide anywhere so now there is one here! If you have other suggestions, feel free to add them or post them in the comments.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been banging my head against the wall with this odd behaviour on
I have been banging my head on a wall with this one. I need
I am having a problem and have been banging my head aginst a wall...
I've been banging my head against a brick wall for nearly two days on
I've been banging my head off a brick wall with this one and another
Been banging my head against this problem all morning. I have setup a connection
I have been banging my head against the wall for a few hours on
I have been banging my head against the wall on this one, for some
I have been banging my head against the wall- can anyone help with working
I have been banging my head against the wall trying to get Exscript installed.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.