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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:57:31+00:00 2026-05-13T22:57:31+00:00

I have been tasked with automating our build process with msbuild. We have about

  • 0

I have been tasked with automating our build process with msbuild. We have about twenty Visual C++ projects and twenty C# projects making it a pain to hand edit all the version strings. Our version numbers are meat-generated at build time, so we need to pass the full version string as a property on the command line.

My initial implementation used the MSBuild Extension Pack‘s File task to do replacements on the .rc and AssemblyInfo.cs files.

<FileSystem.File TaskAction="Replace" Files="@(AssemblyInfoFiles)" RegexPattern='\[assembly: AssemblyVersion\(".*"\)\]' Replacement='[assembly: AssemblyVersion("$(Version)")]'/>
<FileSystem.File TaskAction="Replace" Files="@(AssemblyInfoFiles)" RegexPattern='\[assembly: AssemblyFileVersion\(".*"\)\]' Replacement='[assembly: AssemblyFileVersion("$(Version)")]'/>
<FileSystem.File TaskAction="Replace" Files="@(RCFiles)" RegexPattern="FILEVERSION\s+\S+" Replacement="FILEVERSION $(Version)"/>
<FileSystem.File TaskAction="Replace" Files="@(RCFiles)" RegexPattern="PRODUCTVERSION\s+\S+" Replacement="PRODUCTVERSION $(Version)"/>
<FileSystem.File TaskAction="Replace" Files="@(RCFiles)" RegexPattern='VALUE\s+"FileVersion",\s*".*"' Replacement='VALUE "FileVersion", "$(Version)"'/>
<FileSystem.File TaskAction="Replace" Files="@(RCFiles)" RegexPattern='VALUE\s+"ProductVersion",\s*".*"' Replacement='VALUE "ProductVersion", "$(Version)"'/>

This is working great on the AssemblyInfo.cs files, but when I compile any of the C++ projects I get errors like this:

.\MyProject.rc(23): error RC2135: file not found: 0x09
.\MyProject.rc(71): error RC2135: file not found: 1
.\MyProject.rc(72): error RC2135: file not found: 6
.\MyProject.rc(73): error RC2135: file not found: 6
.\MyProject.rc(74): error RC2135: file not found: 0x3fL
.\MyProject.rc(80): error RC2135: file not found: FILEOS
.\MyProject.rc(81): error RC2135: file not found: 0x2L
.\MyProject.rc(84): error RC2164: unexpected value in RCDATA
.\MyProject.rc(86): error RC2135: file not found: BLOCK
.\MyProject.rc(88): error RC2135: file not found: VALUE

The first error is encountered on line 23, but when I diff MyProject.rc against source control everything looks OK. Only the version numbers are changed, those changes begin on line 72, and the string 0x09 does not appear anywhere in the file. What in the world is going on here? Lines 21 – 25 look like this:

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

I’m also open to any suggestions on other methods to accomplish the same goal.

  • 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-13T22:57:32+00:00Added an answer on May 13, 2026 at 10:57 pm

    The Replace TaskAction was inserting Unicode characters while the rc files are using ASCII encoding. Adding TextEncoding=”ASCII” to all the rc replacement tasks results in compilable files.

    A limitation of using the ASCII character set is that you can’t use the © symbol.
    But if you choose TextEncoding=”Windows-1252″ that solves the problem.

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

Sidebar

Ask A Question

Stats

  • Questions 338k
  • Answers 339k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer To return all of the contents a given array /… May 14, 2026 at 4:24 am
  • Editorial Team
    Editorial Team added an answer A quick and easy way to do this using the… May 14, 2026 at 4:24 am
  • Editorial Team
    Editorial Team added an answer memset(void* memory, int value, size_t size) So, it's not to… May 14, 2026 at 4:24 am

Related Questions

I have been tasked with implementing a PKI library in C# for a company
I have been tasked with going through a number of ColdFusion sites that have
I have been tasked with coming up with a compatibility guide for SharePoint 2007
I have been tasked with developing a solution that tracks changes to a database.
I have been tasked with finding an open source DOM XML parser. The parser

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.