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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:36:14+00:00 2026-05-14T04:36:14+00:00

I’ve written a PowerShell script to build several .net solutions one after the other.

  • 0

I’ve written a PowerShell script to build several .net solutions one after the other. It simply makes several calls to tfget (to get latest) followed by calls to devenv.exe (to build the .sln files).

Here’s the code:

tfget -item $SolutionPath -overwrite -recurse -ev +errors
...
$out = invoke-expression "devenv.com /rebuild debug $SolutionPath"

Almost every time I run the script one of the solutions fails to build and I get an error from CSC.exe (?) saying:

error CS1606: Assembly signing failed;
output may not be signed — The
process cannot access the file because
it is being used by another process.

This happens even though I’ve closed all instances of Visual Studio holding these solutions and I’ve none of their exes running on my machine.

A similar batch file that I’ve written works just fine. It’s only PowerShell that complains about the file being used by another process.

How can I avoid having this happen? Are there any better examples out there of building .net solutions through PowerShell?

  • 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-14T04:36:14+00:00Added an answer on May 14, 2026 at 4:36 am

    Don’t use invoke-expression. Just call devenv.exe directly on the SLN file (or for that matter just use MSBuild.exe unless you have setup or other unsupported project types). One of the beauties of using a shell scripting language is that they are designed to work with console exes rather seamlessly. We do this all the time in PowerShell scripts:

    msbuild.exe "R:\Source\Foo.sln" /t:build /p:Configuration=Debug `
        /v:detailed 2>&1 | Out-String -stream -width 1024 > $DebugBuildLogFile
    

    We run the output through Out-String so that the log file output doesn’t wrap at 80 or 120 chars (default width of the console that runs the script).

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

Sidebar

Ask A Question

Stats

  • Questions 368k
  • Answers 368k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer No, but you can get a wordlist from various places.… May 14, 2026 at 6:09 pm
  • Editorial Team
    Editorial Team added an answer Just set a breakpoint on exit: (gdb) b exit May 14, 2026 at 6:09 pm
  • Editorial Team
    Editorial Team added an answer Move the named scope to your Product model, since that's… May 14, 2026 at 6:09 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.