AssemblyVersionAttribute not shown in Windows Explorer's Deatil View

  • Thread starter Thread starter Zdenko
  • Start date Start date
Z

Zdenko

Hi all,

I have following line in AssemblyInfo.cpp file:

[assembly:AssemblyVersionAttribute("4.0.4000.29")];

When I build managed application, FileVersion column in Windows explorer is
empty.
When I build C# dll, it is displayed correctly.

How can I display Assembly attributes in Windows explorer?

BR
Zdenko
 
You'll have to add a FileVersionRessource manually.
Right click in your project node and select add->Ressource, choose
Version and press ok.

There will appear a file version ressource node in the ressource windows
tree view
where you can change the file version.

In C# the assembly version automatically equals the file version.
It seems to be a bug that you can transver 2 different file versions along
with 1 managed c++ assembly.

Greetings, Sebastian Dau.
 
Thanks,
I was thinking that there is ".NET" way (using AssemblyInfo.cpp).

What is the purpose of AssemblyFileAttributes if it has to be specified in
resource?

Zdenko

Sebastian Dau said:
You'll have to add a FileVersionRessource manually.
Right click in your project node and select add->Ressource, choose
Version and press ok.

There will appear a file version ressource node in the ressource windows
tree view
where you can change the file version.

In C# the assembly version automatically equals the file version.
It seems to be a bug that you can transver 2 different file versions along
with 1 managed c++ assembly.

Greetings, Sebastian Dau.

Zdenko said:
Hi all,

I have following line in AssemblyInfo.cpp file:

[assembly:AssemblyVersionAttribute("4.0.4000.29")];

When I build managed application, FileVersion column in Windows explorer
is empty.
When I build C# dll, it is displayed correctly.

How can I display Assembly attributes in Windows explorer?

BR
Zdenko
 
Zdenko,
Thanks,
I was thinking that there is ".NET" way (using AssemblyInfo.cpp).

What is the purpose of AssemblyFileAttributes if it has to be specified in
resource?

Actually, the assembly file version is not the version of the file, but of
the assembly. It's just that, for convinience, C# and VB.NET will generate a
version resource with the same number for the executable (C++ currently does
not). But even on those, you can change the version number on the file to
make it different from the assembly file version via the
AssemblyInformationVersionAttribute (I think that's the name)
 
Could you explain how to carry different file and assembly versions
in c# assemblies? We are very interested in this since we use this "feature"
for our mananged c++ assemblies.

Could you give me a more detailed advice Tomas?

Thanks in advance! Sebastian Dau
 
Sebastian,
Could you explain how to carry different file and assembly versions
in c# assemblies?

For C# assemblies, it is easy. The following sets the assembly version to
1.1.0.0 and the file version to 1.1.0.3222:

[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyInformationalVersion("1.1.0.3222")]

This is actually very similar to what the .NET framework assemblies do
(notice that all have a different assembly and file versions). Keep in mind,
though, that the file version is *not* taken into account by the .NET
runtime for component versioning.

We are very interested in this since we use this "feature"
for our mananged c++ assemblies.

Well, for that just use [AssemblyVersion] to set the assembly version and a
FIleVersion resource for the rest.
 
Hello Tomas,

thanks for your response it appears to be exactly what I was looking for.
The man C++ way was known but non of us was aware of the
AssemblyInformationalVersion.

Thanks in advance, Sebastian Dau

Tomas Restrepo (MVP) said:
Sebastian,
Could you explain how to carry different file and assembly versions
in c# assemblies?

For C# assemblies, it is easy. The following sets the assembly version to
1.1.0.0 and the file version to 1.1.0.3222:

[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyInformationalVersion("1.1.0.3222")]

This is actually very similar to what the .NET framework assemblies do
(notice that all have a different assembly and file versions). Keep in
mind, though, that the file version is *not* taken into account by the
.NET runtime for component versioning.

We are very interested in this since we use this "feature"
for our mananged c++ assemblies.

Well, for that just use [AssemblyVersion] to set the assembly version and
a FIleVersion resource for the rest.
 
Tomas,

in addition I'd like to let you know that the file version for c# assemblies
is not set through the AssemblyInformationalVersionAttribute but with the
AssemblyFileVersionAttribute.

Anyway, you did guide me into the right direction.
Thanks again! Sebastian Dau



Tomas Restrepo (MVP) said:
Sebastian,
Could you explain how to carry different file and assembly versions
in c# assemblies?

For C# assemblies, it is easy. The following sets the assembly version to
1.1.0.0 and the file version to 1.1.0.3222:

[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyInformationalVersion("1.1.0.3222")]

This is actually very similar to what the .NET framework assemblies do
(notice that all have a different assembly and file versions). Keep in
mind, though, that the file version is *not* taken into account by the
.NET runtime for component versioning.

We are very interested in this since we use this "feature"
for our mananged c++ assemblies.

Well, for that just use [AssemblyVersion] to set the assembly version and
a FIleVersion resource for the rest.
 
Back
Top