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

  • Home
  • SEARCH
  • 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 8085285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:03:56+00:00 2026-06-05T18:03:56+00:00

I publish my web application using msbuild by calling following command: msbuild myweb.csproj /T:Package

  • 0

I publish my web application using msbuild by calling following command:

msbuild myweb.csproj /T:Package /P:PackageLocation=obj\Output\myweb.zip

The content of zip file has always deep folder structure containing full path from drive root to the project folder. Is there any way how to make it more flat? I would like to have a project folder like root in zip.

  • 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-06-05T18:03:59+00:00Added an answer on June 5, 2026 at 6:03 pm

    You can use _PackageTempDir instead of PackageLocation for IIS-like flat structure, but if you want to keep the .zip and .cmd with manifests then no, you can’t really get away from absolute paths without rewriting Microsoft.Web.Publishing.targets or a custom task due to the way the var is used.

    <_PackageTempDir>$(PackageTempRootDir)\PackageTmp</_PackageTempDir>
    <_PackageTempDirFullPath>$([System.IO.Path]::GetFullPath($(_PackageTempDir))</_PackageTempDirFullPath>
    <_MSDeployDirPath Include="$(_PackageTempDir)" />
    <_MSDeployDirPath_FullPath>@(_MSDeployDirPath->'%(FullPath)')</_MSDeployDirPath_FullPath>
    

    You can however trick msbuild and flatten it a little bit by hiding the absolute path with a local share, something like this:

    net share foo=D:\Temp
    msbuild WebApplication1.csproj /t:Package /p:PackageTempRootDir=\\localhost\foo
    

    That’ll change your deep local path to something like obj\Debug\Package\WebApplication1.zip\Content\_S_Slocalhost_Sfoo\PackageTmp

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

Sidebar

Related Questions

Possible Duplicate: How do I publish a Asp.net web application using MSBuild? I have
Has anyone had success making an msbuild file that will publish a Web Application,
I'm using the Publish Web action to deploy my web application. Is there a
Is there a way to have the publish command on a web application not
I am using Visual Studio 2008 and trying to publish a Web Application Project,
Given a Java web application using CometD, how can I publish a message to
Is there a way to publish asp.net web application using PSAKE, just like visual
When using the built-in Publish feature of Visual Studio 2010 with a web application
I am trying to publish an Asp.net MVC web application locally using the NAnt
The article here :: http://www.microsoft.com/web/post/how-to-publish-a-web-application-using-webmatrix states that to publish via FTP I must enter

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.