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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:36:09+00:00 2026-06-05T16:36:09+00:00

Maybe I just can’t figure out the right keywords to get an answer out

  • 0

Maybe I just can’t figure out the right keywords to get an answer out of Google, but here goes.

Say I have a Project I’m working on named “Project.” For it’s first version, I have it stored in the folder “Project_Version1”, and have the name of it’s solution, project, build exe, etc as “Project_Version1”.

Now I want to make the next version of the Project, and call it “Project_Version2”. To do this currently, I copy the original folder, and rename it to “Project_Version2”, and I want to rename all of the other internal stuff to that as well. Currently, I have to do that with a combination of changing the names in windows explorer, and some of the various properties pages in my solution.

There has to be a better way to do this. How does somebody make a second version of their project, and store it’s files separately from the first version? Is there a way to also rename appropriate files that contain version numbers?

  • 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-05T16:36:11+00:00Added an answer on June 5, 2026 at 4:36 pm

    You can do some pretty neat tricks with MSBuild. Let’s say, for instance, that this is your project.

    Program.cs:

    namespace MyCustomBuild
    {
        class Program
        {
            static void Main(string[] args)
            {
                System.Console.WriteLine("Hello World");
            }
        }
    }
    

    Create your MSBuild file as shown. build.msbuild:

    <?xml version="1.0" encoding="utf-8"?>
    <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    
      <PropertyGroup>
        <MajorVersion>1</MajorVersion>
        <MinorVersion>0</MinorVersion>
      </PropertyGroup>
    
      <Target Name="Default">
    
        <CombinePath BasePath="$(MSBuildProjectDirectory)"
                     Paths="Program.$(MajorVersion).$(MinorVersion)">
          <Output TaskParameter="CombinedPaths" PropertyName="OutputDir"/>
        </CombinePath>
    
        <MakeDir Directories="$(OutputDir)"/>
    
        <Csc Sources="program.cs" 
             OutputAssembly="$(OutputDir)\Program.$(MajorVersion).$(MinorVersion).exe"/>
    
      </Target>
    
    </Project>
    

    After running msbuild build.msbuild, this is the result:
    enter image description here

    Ways to make what I posted even better:

    1. Use the MSBuild Extension Pack AssemblyInfo. This will allow you to change the version info if you have it defined inside an AssemblyInfo.cs file. Or you can look into the GenerateApplicationManifest Task, which can set assembly versions, but as of right now the file version of the executable will always be 1.0.0.0
    2. Implement some sort of autoincrement system like this one
    3. You can copy all your source files into the versioned directory using the Copy Task

    It’s a lot to take in, especially if you aren’t familiar with MSBuild, but it’s a powerful program that allows customization that Visual Studio can’t even imagine! Note that a solution file (.sln) is a MSBuild file, even though it’s not xml.

    Hopefully this is what you are looking for. I do also recommend that you use an official version control, as others have mentioned, but you seemed to have a specific task you wanted automated, which is MSBuild’s forte.

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

Sidebar

Related Questions

Maybe it's just too early but I can' figure out why I can't get
I can't figure out why (or maybe you just can't do this) I get
I have a problem, that is maybe silly, but I just can't figure out
Maybe this is a very simple question, but I just can not figure out.
This maybe a simple mistake but i just can't seem to find out what
Ok so maybe I am just blanking out here but I am making a
Maybe I'm just not googling the right parameters, but I just can't seem to
I just can't figure out how is this happening, maybe you guys can help
Maybe I am just falling asleep (or not!), but how can you do this:
Maybe I just haven't figured out the InfoPath paradigm yet, but any links, or

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.