Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friend.

I want to create different versions of exe by c# programming by main application.

For example.

suppose, My main application will have full data for Asp.net, PHP, Windows interview question and answer. Now, by using this application, I should create 5 application(EXE file) for asp.net, 5 application for php and 5 application for windows. So I can easily manage all version by main application.

Is that possible in c#.net?

Thanks

[Moved from Solution to here by Editor]

I think you guys don't understand my requirement. I am not talking about version attribute like 1.1.2.0.

Thank you all of you to reply.

Actually I am web developer and My company got window application project [Windows Form]. I was just confisue how to maintain different version of application by main application as I discussed in my first post.

My client requirement as per below.

1. Main application means they will add question and its answer options in particular platform. (asp.net, php, windows form)

2. And they will sell software in CD for each platform with diffrent registration key.

I was confisued on following points.

1. Do I have to create different application for each platform. (asp.net, php, windows form, etc....)

2. If yes, then how I manage those application by my main application?

3. How I add different registration key for each EXE program.

4. How I manage database for all application.

Now, I reach following conclusion, Please let me know if I am wrong on any points.

1. Create main application to manage database.

2. I will create access file database to manage each platform and by main application, I will store data appropriat access file.

3. I will create another one common application to manage each platform.

4. By main application, I will provide a funcation where client can create application, for example, If he want to create EXE for asp.net, then I will copy access data file of asp.net, EXE of common application and put them in another folder so client can burn that folder in CD.

But still I have some queries.

1. How to change registration key in EXE file which is stored in common application when client create application. [I mean copy exe as point 4]

2. I think access file should be included in EXE file that will not possible in my case.


In short, my client want to create individual software for asp.net, php, windows form, etc... interview question and answer means in asp.net CD, you will not have PHP, Windows Form question answers. I want to manage this situation by one application.
Posted
Updated 3-May-12 23:22pm
v3
Comments
Lakamraju Raghuram 2-May-12 8:01am    
I think this is wrong approach to your problem
Shahin Khorshidnia 2-May-12 8:11am    
Don't!
Imran Khan Pathan 2-May-12 8:16am    
If don't then how it will manage if I need to create thousand of CD for asp.net, PHP, windows interview question and answer?
ZurdoDev 2-May-12 10:35am    
One Exe. It loads the different data.
Shahin Khorshidnia 2-May-12 17:53pm    
Yes, and I think database is a good thing :D

1 solution

It is more possible with .NET than, perhaps, with anything else. Look at your "AssemblyInfo.cs". It usually has the attribute applied on the assembly level:

C#
[assembly: AssemblyVersion("1.2.3.4")]


You can always write this attribute, modify it according to your versioning policy, etc.

The attribute type uses is System.Reflection.AssemblyVersionAttribute. Please see:
http://msdn.microsoft.com/en-us/library/system.reflection.assemblyversionattribute.aspx[^].

Due to limitation of the attributes, it has a string property Version, but you can also parse it as a class System.Version:
http://msdn.microsoft.com/en-us/library/system.version.aspx[^].

This type has everything you may need for version management: semantic comparison is defined, it can be serialized/deserialized, converted to string and parsed from string (which you need for using the AssemblyVersionAttribute. You can use System.Reflection.Assembly.GetCustomAttributes to check if this attribute defined for any given assembly, if it is, extract the version string and parse as the Version instance. Please see:
http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getcustomattributes.aspx[^].

That's all you need.

Good luck,
—SA
 
Share this answer
 
v2
Comments
VJ Reddy 2-May-12 11:01am    
Nice answer. 5!
Sergey Alexandrovich Kryukov 2-May-12 12:26pm    
Thank you, VJ.
--SA
Shahin Khorshidnia 2-May-12 18:00pm    
I think if Imran khan really wants to do what he says; he will find all he'll need in this solution.
But I still suggest him "Don't".
By the way my vote for this perfect answer is +5.
Sergey Alexandrovich Kryukov 3-May-12 13:14pm    
Thank you, Shahin.

I would say your don't is not fully definitive. I mean, in version management, there can be many "do" and many "don't". What exactly do you mean?
I don't think you would say "don't touch versions at all", but OP's "So I can easily manage all version by main application" sounds suspicious.
I would say it's likely that OP would do something wrong, but we don't know what exactly. Perhaps you could explain your advice more exactly, because your "don't" raises a question "don't do what?".

In fact, version management is important thing; and I have automated version management which is very important in several aspects. This is the case when software is developed and more them one version is deployed, etc.
--SA
Shahin Khorshidnia 3-May-12 14:25pm    
Hello SA, I think, There are 2 (or maybe 3) different general understanding of the question: "1. He wants to manage some different version of exe applications with a main application." and "2. He wants an application to help him creating many version of his applications" I got the first one. Maybe there be another. As I understood, I saied Don't because why did he have to apply a distributed solution? He could collect all features in one aggregated application. (I thought so) but now, maybe there be another aim that I haven't realized.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900