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 6724625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:42:44+00:00 2026-05-26T09:42:44+00:00

I use Asp.net 4 C# and MicrosoftAjax Minifier. Please look at my code here;

  • 0

I use Asp.net 4 C# and MicrosoftAjax Minifier.

Please look at my code here; Using <Target Name="AfterBuild"> I’m able to minify all files .js and .css. The problem is that this code minify even the original files in my project solution, so would be almost impossible to edit theme once again.

I need instead minify all .js and .css on my solution after publishing it to a local folder.

In this way I can keep my original files in my project folder intact and have instead the site compiled and minified into another local folder.

I change my scripting using <Target Name="Publish">, I do not receive any error but It does not work.

Could you tell me what I’m missing here, and if there is a better approach to solve this problem? Thanks

<!-- Minify all JavaScript files that were embedded as resources -->
<Import Project="$(MSBuildExtensionsPath)\Microsoft\MicrosoftAjax\ajaxmin.tasks" />
<Target Name="Publish">
    <ItemGroup>
        <JS Include="**\*.js" Exclude="**\*.min.js;Scripts\*.js" />
    </ItemGroup>
    <ItemGroup>
        <CSS Include="**\*.css" Exclude="**\*.min.css" />
    </ItemGroup>
    <AjaxMin
        JsSourceFiles="@(JS)"  JsSourceExtensionPattern="\.js$" JsTargetExtension=".js"
        CssSourceFiles="@(CSS)" CssSourceExtensionPattern="\.css$" CssTargetExtension=".css"  />
</Target>
  • 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-26T09:42:44+00:00Added an answer on May 26, 2026 at 9:42 am

    (copied from questions)

    To deal with losing the original js/css files, ensure the target filenames include .min, eg. JsTargetExtension=".min.js" and CssTargetExtension=".min.css". See article on using MsAjax minifier: http://www.asp.net/ajaxlibrary/ajaxminquickstart.ashx

    To then be able to publish the minified files, see this article: Using Microsoft AJAX Minifier with Visual Studio 2010 1-click publish

    At my workplace, we are solving the minifying issue quite differently by using Chirpy addin for Visual Studio. It automatically minifies files to a .min version upon saving. See http://chirpy.codeplex.com/

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

Sidebar

Related Questions

Under what circumstances would you use MicrosoftAjax over jQuery in an ASP.NET MVC application?
We use ASP.NET / C#. We work locally, test locally, check in our code
I use ASP.NET and WCF services in a load balanced web server environment, using
I use ASP.net Ajax on my project. and using Session for state management. in
I use asp.net 4 c# and ef4. I have this code, it should compile
We use asp.net where I work and we are using c# as the language.
I use ASP .Net 4 and I have a project using the form web
We use ASP.Net 4.0. In our code we regularly use Response.AddHeader(x, y) . Is
Is it possible to re-use a client-template using asp.net ajax 4.0 client templates? I
I use asp.net c# using Web Forms. I use Routing for my website. I

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.