开发者

File version in AssemblyInfo.cs not reflected in Windows Explorer File Properties?

I've got a VS2010 project that contains an AssemblyInfo.cs file. This has:

[assembly: AssemblyFileVersion("10.0.1.0")]

When I run my app and ask for the file version from the executing assembly it picks up 10.0.1 no problem. However, if I right-click on the .exe file in Windows Explorer and open the properties dialog - the Details tab shows a File Version of 10.0.0.0(!)

Why doesn't Windows see 10.0.1 for the file version? I must be missing something...

Additional info: If I add a Version Resource to my app's .res file then the information shows up in the compiled exe开发者_运维问答cutable, but if I don't have the info in the Version Resource the compiled exe ignores the file and "informational" (i.e. Product) version attributes in AssemblyInfo.cs.


Do you have, by any chance a .RC or .RES file included in your project that contains a Version-Resource Definition? Maybe a custom build target or script adds it? If that is the case, it would be picked up instead of the version defined in AssemblyVersion.cs (at least that is what Michael Kaplan says here).

In that article series he also shows that the version information from a ".MUI" file could overlay the version information from the actual EXE file - although, if I understand that correctly, is only an "issue" with native/unmanaged builds.


I am on VS2008 for SmartDevice development. After changing the version number in AssemblyInfo.cs to "2.1.*" , I found it impossible to revert the change. No matter what I do.

After removing the <project_name>.suo, bin/ *, obj/ *, cleaning/rebuilding in release, debug mode, nothing seems to make any difference.

Finally I uninstall the app from CE device first, and retried again. This time, Assembly.GetExecutingAssembly().GetName().Version starts to report the correct version.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜