Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Impact of identical GUID across applications

Whenever I have a new C# project, I often copy/rename an existing one in order to re-use most of the code. This means going into Assembly Info and renaming the project in there as well. In the past, I haven't really bothered with renaming the GUID.

Is this bad programming practice and could it negatively impact the user if they have another program open with the same GUID?

I am by no means an expert programmer, but I get by and I figure things out as I go along. Any advice would be welcome.

like image 506
Riegardt Steyn Avatar asked Dec 13 '25 05:12

Riegardt Steyn


2 Answers

I would say blind copy/paste vs smart re-use is in general a bad practice, but if you update the values in the assemblyInfo you might be on the safe side.

Personally I always assign a different Guid to every project if I copy that file, but anyway the AssemblyGuid attribute is used only for COM interoperability so if you are making pure .NET class libraries or applications and you have ComVisible set to false because you don't expose anything via COM, you shouldn't worry and there wont be any impact on anything else.

like image 161
Davide Piras Avatar answered Dec 14 '25 19:12

Davide Piras


If you are copy/pasting so often, consider extracting the common code into a library and referencing it from your other projects. This has advantages due the reduced maintenance when you make a change of fix a bug.

like image 23
Bas Avatar answered Dec 14 '25 20:12

Bas