Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
OriginalGriff11-Sep-15 2:02
mveOriginalGriff11-Sep-15 2:02 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
Bartosz Jarmuż11-Sep-15 2:24
Bartosz Jarmuż11-Sep-15 2:24 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
OriginalGriff11-Sep-15 2:33
mveOriginalGriff11-Sep-15 2:33 
AnswerRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
F-ES Sitecore11-Sep-15 3:58
professionalF-ES Sitecore11-Sep-15 3:58 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
Bartosz Jarmuż11-Sep-15 4:40
Bartosz Jarmuż11-Sep-15 4:40 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
Bartosz Jarmuż11-Sep-15 7:15
Bartosz Jarmuż11-Sep-15 7:15 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
F-ES Sitecore12-Sep-15 2:19
professionalF-ES Sitecore12-Sep-15 2:19 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
David A. Gray11-Sep-15 11:14
David A. Gray11-Sep-15 11:14 
Over a decade of working with the .NET Framework, I've learned some hard lessons about developing and using helper classes. My rules of thumb for helper classes are simple and straightforward.

1) Target the lowest version of the framework that supports the method, defaulting to 2.0.

2) Segregate classes by target framework.

3) Keep helper assemblies out of the Global Assembly Cache.

I repeat: Stay away from the GAC. It's a sand trap. I've had no end of grief from putting assemblies into it.

First, everything that goes into the GAC must be signed with a strong name, which means that you must keep up with the key file and its passphrase.

Second, it adds a step to the installation, which requires you to either know the whereabouts of GACUTIL.exe on their machine, or ship a copy with your package.

Third, the GAC on the user's machine becomes cluttered with old versions of your assembly, which may have become obsolete. So, you have created for yourself another maintenance issue.

OTOH, if you put the helpers into one or more assemblies, each in its own project, then set a reference that points to the Release build of the assembly (in the /bin/Release directory of the project), it gets copied automatically into the /bin/release directory of your current project. If you change the satellite assembly, the next build of any project that has a reference to it gets a fresh copy. When you are ready to ship, everything you need to ship should be in the /bin/Release directory, which was the point behind the much-touted XCOPY install.

With respect to the routines that require the 4.5 framework and runtime, put them into a separate assembly, and set a reference to it only when your project actually uses one of them.
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
jschell11-Sep-15 11:58
jschell11-Sep-15 11:58 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
F-ES Sitecore12-Sep-15 2:17
professionalF-ES Sitecore12-Sep-15 2:17 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
David A. Gray12-Sep-15 20:12
David A. Gray12-Sep-15 20:12 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
F-ES Sitecore13-Sep-15 3:03
professionalF-ES Sitecore13-Sep-15 3:03 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
David A. Gray13-Sep-15 7:03
David A. Gray13-Sep-15 7:03 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
jschell13-Sep-15 12:07
jschell13-Sep-15 12:07 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
jschell13-Sep-15 12:04
jschell13-Sep-15 12:04 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
F-ES Sitecore13-Sep-15 22:16
professionalF-ES Sitecore13-Sep-15 22:16 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
jschell15-Sep-15 11:24
jschell15-Sep-15 11:24 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
F-ES Sitecore15-Sep-15 22:07
professionalF-ES Sitecore15-Sep-15 22:07 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
jschell17-Sep-15 12:05
jschell17-Sep-15 12:05 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
F-ES Sitecore17-Sep-15 21:24
professionalF-ES Sitecore17-Sep-15 21:24 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
jschell18-Sep-15 13:22
jschell18-Sep-15 13:22 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
F-ES Sitecore19-Sep-15 3:34
professionalF-ES Sitecore19-Sep-15 3:34 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
jschell19-Sep-15 5:23
jschell19-Sep-15 5:23 
GeneralRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
F-ES Sitecore20-Sep-15 0:21
professionalF-ES Sitecore20-Sep-15 0:21 
AnswerRe: Advantages of using .dll files over linking .cs files to projects (for my own generic helper classes / extension methods) Pin
jschell11-Sep-15 11:57
jschell11-Sep-15 11:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.