0

I have a project in which

[assembly: AssemblyProduct("Meteor Viewer")]
[assembly: AssemblyVersion("2.1.0.0")]
[assembly: AssemblyFileVersion("2.1.0.0")]

exist not in assembly.info, but in xyz.cs file. how can I get assembly attribute from xyz.cs at any other page of product?

murmansk
  • 845
  • 2
  • 11
  • 28
  • 3
    Not sure I understand what the question is. Regardless of *which* .cs file those lines are in, as long as that file is compiled with the rest of the project, those attributes will be placed on the assembly (the dll). As such, anywhere you try to find and read those attributes would find them just fine, again, regardless of which file they were in. Can you please explain more what the problem is? How are you reading those attributes? – Lasse V. Karlsen Jul 28 '17 at 06:58
  • @LasseV.Karlsen just had doubt if assembly attribute pick through all the project or only through assembly.info – murmansk Jul 28 '17 at 11:33

1 Answers1

1

The attributes you mentioned are valid at any code file as long as it is part of your project and is compiled. If you have multiple projects in a solution that should share e.g. the version information for all assemblies you can even use one file and link it in all projects instead of copying the infos.

Right click on the project --> Add Existing Item --> Select your File --> Add as Link

enter image description here

When you included the file in your project(s) you can see this answer for how to get the values out of it: https://stackoverflow.com/a/909583/254797

Philipp Grathwohl
  • 2,726
  • 3
  • 27
  • 38