Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# projects, proper versioning, company, etc on deployment

My company is working towards moving our development from C++.net into C#. Our product has standard monthly release (for instance, 5.0.19.2...).

In in C++.net, we had a common app.rc file, that standardized the company info, as well as version number. Since every project within the solution would include the same app.rc file once, it was very easy to change the version info on over 200 projects.

How does this solution translate into the C# world? The questions that I checked before writing this mention it through the property window in the solution explorer, but that is not what I want.

I know the assemblyinfo.cs contains the information I want to modify, but I don't think I could have one master file. Do I need to split it up into multiple files?

Thanks in advance!

like image 558
greggorob64 Avatar asked Jul 19 '11 19:07

greggorob64


People also ask

What C is used for?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...

What is C in C language?

What is C? C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories in 1972. It is a very popular language, despite being old. C is strongly associated with UNIX, as it was developed to write the UNIX operating system.

What is the full name of C?

In the real sense it has no meaning or full form. It was developed by Dennis Ritchie and Ken Thompson at AT&T bell Lab. First, they used to call it as B language then later they made some improvement into it and renamed it as C and its superscript as C++ which was invented by Dr.

Is C language easy?

Compared to other languages—like Java, PHP, or C#—C is a relatively simple language to learn for anyone just starting to learn computer programming because of its limited number of keywords.


2 Answers

You can add a file as a link instead of the actual file. E.g, my solution could be:

Solution
    - My Project
        - Properties
            - AssemblyInfo.cs
            - SharedAssemblyInfo.cs (Linked)
    - Solution Items
        - SharedAssemblyInfo.cs

When you add an existing item to the solution, you can use the drop down arrow on the Add link, and select Add as Link. The SharedAssemblyInfo.cs file can contain common/shared assembly attributes, e.g.:

[assembly: AssemblyVersion("2.0.*")]
[assembly: AssemblyFileVersion("2.0.0.0")]

[assembly: AssemblyCompany("My Company")]

... etc. The project local can contain project specific attributes:

[assembly: AssemblyTitle("My Assembly")]

... etc.

like image 191
Matthew Abbott Avatar answered Nov 15 '22 16:11

Matthew Abbott


It's a common practice in c# solutions to comment out version information in the assemblyinfo.cs of each project and then have a single common "shared_assemblyinfo.cs" (named to taste) that contains version information and is shared across all projects...

like image 38
Scrappydog Avatar answered Nov 15 '22 16:11

Scrappydog