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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:56:35+00:00 2026-05-28T06:56:35+00:00

I m running MSBuild script to compile my project and iv set a artifact

  • 0

I m running MSBuild script to compile my project and iv set a artifact path in the general settings of TeamCity. My MSBuild scripts first build and then creates a zip file. I would like to add that zip file as a artifact but when i run the build on TeamCity i get this error:

[17:44:56]: [CreateNightlyZip] Zip
[17:44:56]: [Zip] C:\BuildAgent\Build\Build.proj(55, 5): The process cannot access the file 'C:\BuildAgent\work\c13cf8f192b25cd1\bin\Debug\20120109_Foo.PE.zip' because it is being used by another process.

So it lookes like TeamCity tries to grab the zip file right when its created and then my MSBuild script fails to put files into it.

Here is the MSBuild target:

 <Target Name="CreateNightlyZip">
    <PropertyGroup>
      <StringDate>$([System.DateTime]::Now.ToString('yyyyMMdd'))</StringDate>
    </PropertyGroup>
    <ItemGroup>
      <DebugApplicationFiles Include="$(DebugPath)\**\*.*" Exclude="$(DebugPath)\*vshost.exe*" />
    </ItemGroup>
    <MakeDir Directories="$(NightlyBuildPath)"/>
    <Zip Files="@(DebugApplicationFiles)"
      WorkingDirectory="$(DebugPath)"
      ZipFileName="$(NightlyBuildPath)\$(StringDate)_$(NightlyZipName).zip"
      ZipLevel="9" />
  </Target>

Have anybody had this problem allso or what should be solution for this?

EDIT: What is strange is that when i create zip file in the root of checkout folder then everything works, but when i create it to the Debug folder then i get this error.

  • 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-28T06:56:36+00:00Added an answer on May 28, 2026 at 6:56 am

    What i ended up doing is not to place the created .zip file into the debug folder and just to the project root folder. Doing that the zip file is created and Teamcity is able to use it as artifact.

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

Sidebar

Related Questions

I'm trying to create a MSBuild script for running in TeamCity. I have a
When running the MSBuild scripts for a project, I'm getting the following errors: Properties\licenses.licx(1):
I'm trying to integrate running Fitnesse tests from MSBuild im my nightly build on
I am running a MSBUILD script which disables and enabled a scheduled task from
Using TeamCity running an MsBuild task for an MVC2 C# application, we successfully run
I'm automating my MSBuild-based C# solution build using Hudson running on a Windows machine.
I'm trying to get our build scripts (which use MSBuild) working correctly on Vista
We have a long-running msbuild script that I'm trying to speed up. Is there
We're using CruiseControl.NET which invokes an MSBuild script. While debugging the build script, we
Ive got CC.Net and NAnt (and MSBuild) running on a new VM-based build server

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.