Variable declared but never used AND passing Guid as an attribute parameter

2010-10-05 Thread Paul Noone
Hi all, Please excuse my .NET ignorance but I'm coming at all this from a PHP background and am trying really, really hard to become a real developer. :) I'm debugging someone else's code and would greatly appreciate any explanations for the following. 1.The variable 'ex' is declared but

RE: Variable declared but never used AND passing Guid as an attribute parameter

2010-10-05 Thread Darren Neimke
I'll answer the first question Paul... it's not 'best practice' to go around catching exceptions and doing nothing with them. At the very least, you would log the exception details out somewhere and then rethrow, e.g.: catch (Exception ex) {myLogger.Log(ex) ; throw ;}

Re: Variable declared but never used AND passing Guid as an attribute parameter

2010-10-05 Thread Joseph Clark
Hey Paul, Not sure about your #2 question, but your #1 is an easy fix. The compiler is simply complaining that you have declared the Exception variable ex in your catch block, but then never referenced it. You can have a catch block without an exception variable, like this: try { // code

RE: Variable declared but never used AND passing Guid as an attribute parameter

2010-10-05 Thread Mike MOSSuMS Stringfellow
Catch and re-throw is very expensive (especially if you are bubbling it up - don't code everything this way as it will compound through your code and you'll log it many times). Essentially, make sure it is a true exception and not part of normal expected behaviour. You'd also usually target the

RE: Variable declared but never used AND passing Guid as an attribute parameter

2010-10-05 Thread Paul Noone
Wow. OK. Extremely grateful for the info and am now more confused than ever. I think I'll go with removing the font variable altogether and just declaring a generic Serif. :) Does anybody have any idea about #2? It seems completely alien to me why the Guid would appear within the class code at

ConfigChange

2010-10-05 Thread Paul Noone
Before I deploy and risk trashing my config file, could anyone tell me if there's anything glaringly wrong with the values and method provided to modify an existing node's attribute? Thank you!! new SPWebConfigModification() { Owner = My.Assembly.Name,

Legacy SPS2003 portal - permissions

2010-10-05 Thread Nigel Hertz
Hey all We have an old legacy system based on SPS2003 (don't ask) Is anyone aware of an easy way to change permissions across all document libraries to read-only (for everyone, no exceptions)? I'm guessing it will likely require some custom coding, but though I'd ask if anyone knows of