Throwing exceptions from a constructor should be fine if you have created no unmanaged resources. However, if you do create unmanaged resources in the constructor, the whole body of that constructor, including throws, should be wrapped in a try/catch. To steal JaredPar's great example:
public class Foo : IDisposable {
private IntPtr m_ptr;
public Foo() {
try
{
m_ptr = Marshal.AllocHGlobal(42);
throw new Exception();
}
catch
{
Dispose();
throw;
}
}
// Most of Idisposable implementation ommitted for brevity
public void Dispose() {
Marshal.FreeHGlobal(m_ptr);
}
}
The following would now work:
using ( var f = new Foo() ) {
// Won't execute, but Foo still cleans itself up
}