3

I am building an executable using VS2008 and .NET compact framework 3.5, targetting Windows Mobile 6 professional, but whenever I compile the project, everything that I have specified in the AssemblyInfo.cs file is ignored.

I have done this many times in other projects and it works without problem, but for some reason I cannot get the AssemblyTitle/AssemblyProduct/AssemblyVersion attributes etc to show up (I am trying to view them using Windows Explorer, I am able to see these properties in the details tab for any other assembly that I have built - even other projects in the same solution).

Any suggestions?

Martin Robins
  • 6,033
  • 10
  • 58
  • 95
  • More info: Just discovered that if I create a new smart device exe project targeting windows mobile then assemblyinfo is ignored, but if i create the same project targeting Windows CE then the assemblyinfo is included! Still none the wiser as to why though! Only seems that Windows Mobile exe cannot include assemblyinfo! – Martin Robins Dec 30 '09 at 18:16

3 Answers3

0

I know this is old, but there's a simpler solution posted here:
Version number in .NET Compact Framework application

You have to use reflection. System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Major System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Minor System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Build System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Revision

Community
  • 1
  • 1
fotijr
  • 946
  • 11
  • 20
0

That info is looking at the native version info, which on the desktop is set using the AssemblyFileVersionAttribute. The AssemblyFileVersionAttribute is unsupported in the CF, so the only way to set the version info out of the box is to command-line compile. There is a workaround in this blog.

ctacke
  • 66,480
  • 18
  • 94
  • 155
  • 1
    Thanks, but for another compact framework assembly in another project in the same solution all of the information is set correctly. I have also used this same technique for previous projects without problem. It is just this one project that seems to have an issue. The only difference between these two is that one is an exe and the other a dll (though other exe projects have included this information correctly). – Martin Robins Dec 30 '09 at 17:54
  • re:Martin's, it seems in my case that it is working perfectly fine and as expected for the DLLs in my project, but it does not work at all for EXE projects. I'm Using VS2008,VB.NET also targeting CFv3.5. – eidylon Jul 19 '10 at 16:56
0

in tag PlatformFamilyName; rather that PocketPC, change to add WindowsCE in csproj

Krishan
  • 407
  • 4
  • 13