tags:

views:

1292

answers:

1

what is the right way of using XElement.Save(filepath)? Do I need to call this in a try/catch block all the time? How does it deal with concurrency?

+2  A: 

Exceptions: the normal policy - catch anything you can sensibly deal with (which is relatively rare) and let anything else bubble up the stack.

Concurrency: I wouldn't expect LINQ to XML to be threadsafe to start with. If you're updating the same element from multiple threads, use appropriate locking.

Jon Skeet