AssemblyFileVersion属性被忽略 [英] AssemblyFileVersion attribute is being ignored

查看:196
本文介绍了AssemblyFileVersion属性被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,得到的AssemblyVersion是不同于AssemblyFileVersion在类库我的工作属性。

I am having a problem getting the AssemblyVersion to be different from the AssemblyFileVersion attributes in a class library I am working on.

所以,我试图创建一个空的(除了将Class1.cs)类库,看它是否是一个设置的地方,但我得到了相同的行为。

So, I've tried creating an empty (apart from Class1.cs) class library to see if it's a setting somewhere, but I get the same behaviour.

看来的AssemblyVersion属性只是被忽略。

It seems the AssemblyVersion attribute is just being ignored.

下面是从我的AssemblyInfo.cs文件中的相关位...

Here is the relevant bit from my AssemblyInfo.cs file ...

[assembly: AssemblyVersion("0.1")]
[assembly: AssemblyFileVersion("1.1.0.9")]

和这里的东西怎么看待在Windows资源管理器...

and here is how things look in windows explorer ...

有没有控制这是一个设置的地方?

Is there a setting somewhere that controls this?

编辑: 我发现了一个文件,其中是有区别的,所以它不是Windows资源管理器显示两个不同的领域相同的值,它的东西做的DLL从编译器生成的方法/连接器...

I've found one file where there is a difference, so it's not windows explorer showing the same value for two different fields, it's something to do with the way the DLL is generated from the compiler/linker ...

推荐答案

这里的关键问题是,Windows不知道在管理程序的属性什么。它读取的非托管的文件版本的资源。这已嵌入在C#程序集与/ win32res一个编译选项。默认情况下,编译器自动生成,如果你不使用该选项,使用值您在AssemblyInfo.cs中指定的程序集属性创建资源。

The key problem here is that Windows doesn't know anything about attributes in a managed program. It reads the unmanaged file version resource. The one that's embedded in a C# assembly with the /win32res compile option. The compiler auto-generates it by default if you don't use that option, using the assembly attribute values you specified in AssemblyInfo.cs to create the resource.

但非托管的文件版本的资源并没有一个标准的字段指定如[的AssemblyVersion]任何东西。只有[AssemblyFileVersion。编译器实际上发出,该版本的资源是可扩展的。但是,Windows XP的是,仍然显示这些自定义字段的最后一个版本。你可以看到,非托管资源在Visual Studio中使用文件+打开+文件大会开幕。

But an unmanaged file version resource doesn't have a standard field to specify anything like [AssemblyVersion]. Only [AssemblyFileVersion]. The compiler actually emits it, the version resource is extensible. But Windows XP was the last version that still displays these custom fields. You can see that unmanaged resource by opening the assembly in Visual Studio with File + Open + File.

是的,瘸腿的,烦人。 Windows组在MS不喜欢迎合管理code。

Yes, lame and annoying. The Windows group at MS does not like to cater to managed code.

这篇关于AssemblyFileVersion属性被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆