locked
Version information not included in exe RRS feed

  • Question

  • I migrated and application from VB.NET under VS2003 under CF1.1 to VS 2005 and then VS 2008 SP1 targeting Windows Mobile 6 using CF 3.5.

    When I build the application I do not get version information attached to the executable as I always have.

    AssemblyInfo.vb contains the correct entry as shown below

    <Assembly: AssemblyVersion(

    "1.5.*")>

    I really need a solution to this issue ASAP.

    Thanks

    Tuesday, October 4, 2011 12:35 PM

Answers

All replies

  • Hi,

    Is this "Build Action" property of your AssemblyInfo file marked to "Compile" in VS2008?

     

    Elvis


    Elvis Hsu
    Senior Software Engineer at Barcode Dynamics Australia
    Find me at Linkedin
    Tuesday, October 4, 2011 11:25 PM
  • Unfortunatly, this is a known issue (see http://connect.microsoft.com/VisualStudio/feedback/details/236934/net-cf-2-0-resolution-aware-hi-dpi-do-not-contain-a-native-win32-version-resource and http://connect.microsoft.com/VisualStudio/feedback/details/117311/win32-file-version-of-netcf-assemblies-missing)

    In order to support Hi DPI aware applications, the build system add a Win32 resource file (/win32resource) to the executable. This prevents the compiler from adding the version infomation.

    Here is a workaround:
    1) Create a .rct file in visual studio (File -> new -> Visual C++ -> Resource Template File (.rct)
    2) Add a Version resource to the file (Right Click -> Add Resource -> Version) and save the file
    3) Build the solution
    4) run the tool res2exe (should be located in <..>Windows Mobile 6 SDK\Tools\Resolution Aware) to add the missing version. Sample command line "res2exe -c myversion.rct myapplication.exe

    Michael 


    MVP Windows Embedded
    • Proposed as answer by Michael Koster Friday, October 7, 2011 6:24 AM
    • Marked as answer by Jesse Jiang Wednesday, October 12, 2011 10:36 AM
    Wednesday, October 5, 2011 9:07 AM
  • Elvis:

    Yes it is.

    Wednesday, October 5, 2011 11:09 AM
  • Michael, so I have to run the comman line every time I build to get the version in the app ?

    Sample command line "res2exe -c myversion.rct myapplication.exe"

     

    Wednesday, October 5, 2011 12:59 PM
  • Yes, that's right.

    To automate this, I'd add this as a 'post-build event' to your visual studio project.


    MVP Windows Embedded
    • Proposed as answer by Jesse Jiang Thursday, October 6, 2011 6:52 AM
    Wednesday, October 5, 2011 1:51 PM
  • So to confirm, if I do as you say above it will change the version on every build without me needing to intervene on each build as long as I put the command line code in the post build event?

     


    Wednesday, October 5, 2011 4:56 PM
  • The executable will always have the version you have specified in the .rct file.
    You have to (manually) make sure that the version in AssemblyInfo.vb and the .rct file are in sync.

    The post build event just makes sure you have a version on the EXE file.


    MVP Windows Embedded
    Thursday, October 6, 2011 7:24 AM
  • By the way, generally assembly version and Win32 versions should not be in sync. For purposes of GAC'ing assembly version should stay the same as long as assembly is compatible with previous versions (e.g. bug fixes) while Win32 version should be incremented.

    For example:

    Release 1.1: Assembly: 1.1.0.0, Win 32: 1.1.11035.0

    Release 1.1 bug fix: Assembly: 1.1.0.0, Win 32: 1.1.11270.0

     


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Proposed as answer by Michael Koster Friday, October 7, 2011 6:25 AM
    • Marked as answer by Jesse Jiang Wednesday, October 12, 2011 10:36 AM
    Thursday, October 6, 2011 6:22 PM