Index

A note on the digital index

A link in an index entry is displayed as the section title in which that entry appears. Because some sections have multiple index markers, it is not unusual for an entry to have several links to the same section. Clicking on any link will take you directly to the place in the text in which the marker appears.

Symbols

.NET capabilities not supported by COM, IN A NUTSHELL
.NET framework class library (FCL), GOTCHA #34 Defining an array isn’t consistent
.NET languages, IN A NUTSHELL
sizes of aliases used in, IN A NUTSHELL
.NET Reflector tool, GOTCHA #13 Ordering of catch processing isn’t consist across languages

A

Abort, delay during, IN A NUTSHELL
abstract/MustOverride, GOTCHA #42 Runtime Type Identification can hurt extensibility
abstraction, GOTCHA #42 Runtime Type Identification can hurt extensibility
accessing managed resources, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc
accidental hiding, GOTCHA #44 Compilers are lenient toward forgotten override/overrides, GOTCHA #45 Compilers lean toward hiding virtual methods
AComponent class, GOTCHA #64 Raising events lacks thread-safety, GOTCHA #64 Raising events lacks thread-safety
DoWork() method, GOTCHA #64 Raising events lacks thread-safety
Work() method, GOTCHA #64 Raising events lacks thread-safety
Agile Developer web site, On the Web
aliases, IN A NUTSHELL
sizes of aliases used in .NET languages, IN A NUTSHELL
aliases used in .NET languages, IN A NUTSHELL
apartments, GOTCHA #67 Cross-apartment calls are expensive, GOTCHA #67 Cross-apartment calls are expensive, GOTCHA #67 Cross-apartment calls are expensive, GOTCHA #67 Cross-apartment calls are expensive, GOTCHA #67 Cross-apartment calls are expensive, GOTCHA #68 Default apartment of main thread is inconsistent across languages, GOTCHA #68 Default apartment of main thread is inconsistent across languages
client and component in different, GOTCHA #67 Cross-apartment calls are expensive
cost of, GOTCHA #67 Cross-apartment calls are expensive
effect of related attributes, GOTCHA #67 Cross-apartment calls are expensive
Multithreaded Apartment (MTA), GOTCHA #67 Cross-apartment calls are expensive
Single Threaded Apartment (STA), GOTCHA #67 Cross-apartment calls are expensive
understanding apartment in which your thread is running, GOTCHA #68 Default apartment of main thread is inconsistent across languages
array allocation, GOTCHA #34 Defining an array isn’t consistent
array size differences, GOTCHA #34 Defining an array isn’t consistent
ArrayList, behavior of, GOTCHA #9 Typeless ArrayList isn’t type-safe
arrays, GOTCHA #34 Defining an array isn’t consistent, IN A NUTSHELL
creating, IN A NUTSHELL
inconsistent allocation, GOTCHA #34 Defining an array isn’t consistent
asynchronous access to web service, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
AutoComplete attribute (Enterprise Services), GOTCHA #75 AutoComplete comes with undesirable side effects, GOTCHA #75 AutoComplete comes with undesirable side effects
effect of, GOTCHA #75 AutoComplete comes with undesirable side effects
AutoDispatch, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes, IN A NUTSHELL
exposing .NET component, IN A NUTSHELL
AutoDual, GOTCHA #72 All but one of the ClassInterface options are ineffective

C

C#, GOTCHA #1 Type alias size doesn’t match what you’re familiar with, GOTCHA #1 Type alias size doesn’t match what you’re familiar with, GOTCHA #2 struct and class differ in behavior, GOTCHA #3 Returning value types from a method/property is risky, GOTCHA #3 Returning value types from a method/property is risky, GOTCHA #4 You can’t force calls to your value-type constructors, GOTCHA #5 String concatenation is expensive, GOTCHA #6 Exceptions may go unhandled, GOTCHA #6 Exceptions may go unhandled, GOTCHA #6 Exceptions may go unhandled, GOTCHA #7 Uninitialized event handlers aren’t treated gracefully, IN A NUTSHELL, GOTCHA #8 Division operation isn’t consistent between types, GOTCHA #8 Division operation isn’t consistent between types, GOTCHA #9 Typeless ArrayList isn’t type-safe, GOTCHA #9 Typeless ArrayList isn’t type-safe, GOTCHA #10 Type.GetType() may not locate all types, GOTCHA #10 Type.GetType() may not locate all types, GOTCHA #12 Compiler warnings may not be benign, GOTCHA #12 Compiler warnings may not be benign, GOTCHA #13 Ordering of catch processing isn’t consist across languages, GOTCHA #14 Type.GetType() might fail at run-time, GOTCHA #14 Type.GetType() might fail at run-time, IN A NUTSHELL, GOTCHA #16 Default of Option Strict (off) isn’t good, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #20 Singleton isn’t guaranteed process-wide, GOTCHA #20 Singleton isn’t guaranteed process-wide, GOTCHA #21 Default performance of Data.ReadXMLData.ReadXML, GOTCHA #22 enum lacks type-safety, GOTCHA #22 enum lacks type-safety, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #25 Access to static/Shared members isn’t enforced consistently, GOTCHA #26 Details of exception may be hidden, GOTCHA #26 Details of exception may be hidden, GOTCHA #27 Object initialization sequence isn’t consistent, GOTCHA #28 Polymorphism kicks in prematurely, GOTCHA #29 Unit testing private methodstesting private methods, GOTCHA #29 Unit testing private methodstesting private methods, SEE ALSO, GOTCHA #31 Optional parameters break interoperability, GOTCHA #31 Optional parameters break interoperability, GOTCHA #32 Mixing case between class members breaks interoperability, GOTCHA #32 Mixing case between class members breaks interoperability, IN A NUTSHELL, GOTCHA #33 Name collision with keywords breaks interoperability, GOTCHA #34 Defining an array isn’t consistent, GOTCHA #34 Defining an array isn’t consistent, GOTCHA #34 Defining an array isn’t consistent, GOTCHA #35 Writing Finalize() is rarely a good idea, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc, GOTCHA #38 Depending on Finalize() can tie up critical resources, GOTCHA #39 Using Finalize() on disposed objects is costly, GOTCHA #40 Implementing IDisposable isn’t enough, GOTCHA #40 Implementing IDisposable isn’t enough, SEE ALSO, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #43 Using new/shadows causes “hideous hiding”, GOTCHA #44 Compilers are lenient toward forgotten override/overrides, GOTCHA #45 Compilers lean toward hiding virtual methods, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #47 Signature mismatches can lead to method hiding, GOTCHA #47 Signature mismatches can lead to method hiding, GOTCHA #49 Foreground threads may prevent a program from terminating, GOTCHA #50 Background threads don’t terminate gracefully, GOTCHA #51 Interrupt () kicks in only when a thread is blocked, GOTCHA #52 ThreadAbortException—a hot potato, GOTCHA #53 Environment.Exit() brings down the CLR, GOTCHA #54 ResetAbort() may lead to surprises, GOTCHA #55 Abort() takes time to clean up, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #57 Locking on globally visible objects is too sweeping, GOTCHA #57 Locking on globally visible objects is too sweeping, GOTCHA #58 Threads from the thread pool are scarce, GOTCHA #59 Threads invoked using delegates behave like background threads, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #64 Raising events lacks thread-safety, GOTCHA #65 Release of COM object is confusing, GOTCHA #66 Using interface pointers after calling ReleaseComObject() will fail, GOTCHA #67 Cross-apartment calls are expensive, GOTCHA #67 Cross-apartment calls are expensive, GOTCHA #68 Default apartment of main thread is inconsistent across languages, GOTCHA #69 STAThread attribute may have no effect on your methods, GOTCHA #69 STAThread attribute may have no effect on your methods, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes, GOTCHA #72 All but one of the ClassInterface options are ineffective, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003, GOTCHA #75 AutoComplete comes with undesirable side effects, GOTCHA #75 AutoComplete comes with undesirable side effects
class with mixed case members, GOTCHA #32 Mixing case between class members breaks interoperability
code examples, GOTCHA #1 Type alias size doesn’t match what you’re familiar with, GOTCHA #1 Type alias size doesn’t match what you’re familiar with, GOTCHA #2 struct and class differ in behavior, GOTCHA #3 Returning value types from a method/property is risky, GOTCHA #3 Returning value types from a method/property is risky, GOTCHA #4 You can’t force calls to your value-type constructors, GOTCHA #5 String concatenation is expensive, GOTCHA #6 Exceptions may go unhandled, GOTCHA #6 Exceptions may go unhandled, GOTCHA #6 Exceptions may go unhandled, GOTCHA #7 Uninitialized event handlers aren’t treated gracefully, IN A NUTSHELL, GOTCHA #8 Division operation isn’t consistent between types, GOTCHA #8 Division operation isn’t consistent between types, GOTCHA #9 Typeless ArrayList isn’t type-safe, GOTCHA #9 Typeless ArrayList isn’t type-safe, GOTCHA #10 Type.GetType() may not locate all types, GOTCHA #10 Type.GetType() may not locate all types, GOTCHA #12 Compiler warnings may not be benign, GOTCHA #12 Compiler warnings may not be benign, GOTCHA #13 Ordering of catch processing isn’t consist across languages, GOTCHA #14 Type.GetType() might fail at run-time, GOTCHA #14 Type.GetType() might fail at run-time, IN A NUTSHELL, GOTCHA #16 Default of Option Strict (off) isn’t good, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #20 Singleton isn’t guaranteed process-wide, GOTCHA #20 Singleton isn’t guaranteed process-wide, GOTCHA #21 Default performance of Data.ReadXMLData.ReadXML, GOTCHA #22 enum lacks type-safety, GOTCHA #22 enum lacks type-safety, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #25 Access to static/Shared members isn’t enforced consistently, GOTCHA #26 Details of exception may be hidden, GOTCHA #26 Details of exception may be hidden, GOTCHA #27 Object initialization sequence isn’t consistent, GOTCHA #28 Polymorphism kicks in prematurely, GOTCHA #29 Unit testing private methodstesting private methods, GOTCHA #29 Unit testing private methodstesting private methods, SEE ALSO, GOTCHA #31 Optional parameters break interoperability, GOTCHA #31 Optional parameters break interoperability, GOTCHA #32 Mixing case between class members breaks interoperability, IN A NUTSHELL, GOTCHA #33 Name collision with keywords breaks interoperability, GOTCHA #34 Defining an array isn’t consistent, GOTCHA #34 Defining an array isn’t consistent, GOTCHA #34 Defining an array isn’t consistent, GOTCHA #35 Writing Finalize() is rarely a good idea, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc, GOTCHA #38 Depending on Finalize() can tie up critical resources, GOTCHA #39 Using Finalize() on disposed objects is costly, GOTCHA #40 Implementing IDisposable isn’t enough, GOTCHA #40 Implementing IDisposable isn’t enough, SEE ALSO, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #43 Using new/shadows causes “hideous hiding”, GOTCHA #44 Compilers are lenient toward forgotten override/overrides, GOTCHA #45 Compilers lean toward hiding virtual methods, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #47 Signature mismatches can lead to method hiding, GOTCHA #47 Signature mismatches can lead to method hiding, GOTCHA #49 Foreground threads may prevent a program from terminating, GOTCHA #50 Background threads don’t terminate gracefully, GOTCHA #51 Interrupt () kicks in only when a thread is blocked, GOTCHA #52 ThreadAbortException—a hot potato, GOTCHA #53 Environment.Exit() brings down the CLR, GOTCHA #54 ResetAbort() may lead to surprises, GOTCHA #55 Abort() takes time to clean up, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #57 Locking on globally visible objects is too sweeping, GOTCHA #57 Locking on globally visible objects is too sweeping, GOTCHA #58 Threads from the thread pool are scarce, GOTCHA #59 Threads invoked using delegates behave like background threads, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #64 Raising events lacks thread-safety, GOTCHA #65 Release of COM object is confusing, GOTCHA #66 Using interface pointers after calling ReleaseComObject() will fail, GOTCHA #67 Cross-apartment calls are expensive, GOTCHA #67 Cross-apartment calls are expensive, GOTCHA #68 Default apartment of main thread is inconsistent across languages, GOTCHA #69 STAThread attribute may have no effect on your methods, GOTCHA #69 STAThread attribute may have no effect on your methods, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes, GOTCHA #72 All but one of the ClassInterface options are ineffective, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003, GOTCHA #75 AutoComplete comes with undesirable side effects, GOTCHA #75 AutoComplete comes with undesirable side effects
Abort, GOTCHA #52 ThreadAbortException—a hot potato
Aliases, GOTCHA #1 Type alias size doesn’t match what you’re familiar with, GOTCHA #1 Type alias size doesn’t match what you’re familiar with
Apartment, GOTCHA #67 Cross-apartment calls are expensive, GOTCHA #67 Cross-apartment calls are expensive
Array, GOTCHA #34 Defining an array isn’t consistent, GOTCHA #34 Defining an array isn’t consistent, GOTCHA #34 Defining an array isn’t consistent
ArrayList, GOTCHA #9 Typeless ArrayList isn’t type-safe, GOTCHA #9 Typeless ArrayList isn’t type-safe
BackgroundAbort, GOTCHA #50 Background threads don’t terminate gracefully
BeginInvoke, GOTCHA #59 Threads invoked using delegates behave like background threads
CatchOrder, GOTCHA #13 Ordering of catch processing isn’t consist across languages
ClassInterfaceType, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes, GOTCHA #72 All but one of the ClassInterface options are ineffective
COMInterfaces, GOTCHA #66 Using interface pointers after calling ReleaseComObject() will fail
ControlThread, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous
CopyingObjects, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations
DataSetXMLSpeed, GOTCHA #21 Default performance of Data.ReadXMLData.ReadXML
DefaultApartment, GOTCHA #68 Default apartment of main thread is inconsistent across languages
Delegate, GOTCHA #7 Uninitialized event handlers aren’t treated gracefully, IN A NUTSHELL
DifferInCase, GOTCHA #32 Mixing case between class members breaks interoperability
DisposeFinalize, GOTCHA #40 Implementing IDisposable isn’t enough
DivByZero, GOTCHA #8 Division operation isn’t consistent between types, GOTCHA #8 Division operation isn’t consistent between types
EnumSafety, GOTCHA #22 enum lacks type-safety, GOTCHA #22 enum lacks type-safety
ES, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003
ESAutoComplete, GOTCHA #75 AutoComplete comes with undesirable side effects, GOTCHA #75 AutoComplete comes with undesirable side effects
ExceptionInDeriving, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism
ExceptionInThread, GOTCHA #61 Exceptions thrown from threads in the pool are lost
ExceptionInThread, client-side code, GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost
ExceptionInThread, server-side code, GOTCHA #61 Exceptions thrown from threads in the pool are lost
Finalize, GOTCHA #35 Writing Finalize() is rarely a good idea
GetType, GOTCHA #10 Type.GetType() may not locate all types, GOTCHA #10 Type.GetType() may not locate all types
GUID, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes
HandleException, GOTCHA #6 Exceptions may go unhandled
HandleException, client code, GOTCHA #6 Exceptions may go unhandled
HandleException, library code, GOTCHA #6 Exceptions may go unhandled
HidingMess, GOTCHA #43 Using new/shadows causes “hideous hiding”
Initialization, GOTCHA #27 Object initialization sequence isn’t consistent
Interrupt, GOTCHA #51 Interrupt () kicks in only when a thread is blocked
IsBackground, GOTCHA #49 Foreground threads may prevent a program from terminating
JoinAbort, GOTCHA #55 Abort() takes time to clean up
KnowTheExit, GOTCHA #53 Environment.Exit() brings down the CLR
MethodSignature, GOTCHA #47 Signature mismatches can lead to method hiding, GOTCHA #47 Signature mismatches can lead to method hiding
MultipleWSCalls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
MultipleWSCalls, client side, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
MultipleWSCalls, server side, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
NotToFinalize, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc
Optional, SEE ALSO, GOTCHA #31 Optional parameters break interoperability, GOTCHA #31 Optional parameters break interoperability
OptionStrict, GOTCHA #16 Default of Option Strict (off) isn’t good
ParamThreadSafety, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky
PolymorphismTooSoon, GOTCHA #28 Polymorphism kicks in prematurely
RaisingEventThreadSafety, GOTCHA #64 Raising events lacks thread-safety
RefactoredWrapper, GOTCHA #40 Implementing IDisposable isn’t enough
ReflectionToSerialize, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches
RememberMarkOverride, GOTCHA #44 Compilers are lenient toward forgotten override/overrides
ResetAbortMethod, GOTCHA #54 ResetAbort() may lead to surprises
ResourceHold, GOTCHA #38 Depending on Finalize() can tie up critical resources
Rethrow, IN A NUTSHELL
ReturningValueType, GOTCHA #3 Returning value types from a method/property is risky, GOTCHA #3 Returning value types from a method/property is risky
RTTI, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility
SettingApartment, GOTCHA #69 STAThread attribute may have no effect on your methods, GOTCHA #69 STAThread attribute may have no effect on your methods
Shared, GOTCHA #25 Access to static/Shared members isn’t enforced consistently
SingletonAppDomain, GOTCHA #20 Singleton isn’t guaranteed process-wide, GOTCHA #20 Singleton isn’t guaranteed process-wide
StringAppend, GOTCHA #5 String concatenation is expensive
SuppressingFinalize, GOTCHA #39 Using Finalize() on disposed objects is costly
Synchronizing, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect
SynchWithIntent, GOTCHA #57 Locking on globally visible objects is too sweeping, GOTCHA #57 Locking on globally visible objects is too sweeping
TestPrivate, GOTCHA #29 Unit testing private methodstesting private methods, GOTCHA #29 Unit testing private methodstesting private methods
ThouShaltReleaseObject, GOTCHA #65 Release of COM object is confusing
ThreadFromPool, GOTCHA #58 Threads from the thread pool are scarce
Typeof, GOTCHA #14 Type.GetType() might fail at run-time, GOTCHA #14 Type.GetType() might fail at run-time
Using, SEE ALSO
ValueReferenceTypes, GOTCHA #2 struct and class differ in behavior
ValueTypeConstructor, GOTCHA #4 You can’t force calls to your value-type constructors
VirtualInDerived, GOTCHA #45 Compilers lean toward hiding virtual methods
Warnings, GOTCHA #12 Compiler warnings may not be benign
WarningSideEffect, GOTCHA #12 Compiler warnings may not be benign
WhatsInAName, IN A NUTSHELL, GOTCHA #33 Name collision with keywords breaks interoperability
XMLSerializer, GOTCHA #26 Details of exception may be hidden, GOTCHA #26 Details of exception may be hidden
C# code examples (continued), GOTCHA #9 Typeless ArrayList isn’t type-safe, GOTCHA #12 Compiler warnings may not be benign, GOTCHA #12 Compiler warnings may not be benign, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #31 Optional parameters break interoperability, IN A NUTSHELL, GOTCHA #40 Implementing IDisposable isn’t enough, GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #64 Raising events lacks thread-safety, IN A NUTSHELL, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003, C# Language Specification
communicating with the root object, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003
creating arrays, IN A NUTSHELL
deriving a C# class from a VB.NET class, GOTCHA #31 Optional parameters break interoperability
Dispose design pattern, GOTCHA #40 Implementing IDisposable isn’t enough
example to raise event with thread-safety, GOTCHA #64 Raising events lacks thread-safety
executing thread for different Timers and Delegate, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous
FAQs web site, C# Language Specification
lost exception in asynchronous call, Web service, GOTCHA #61 Exceptions thrown from threads in the pool are lost
lost exception in asynchronous call, Web service client, GOTCHA #61 Exceptions thrown from threads in the pool are lost
multiple calls on web service, client side, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
multiple calls on web service, server side, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
not setting STAThread or MTAThread, IN A NUTSHELL
reflection to serialize and deserialize, GOTCHA #17 Versioning may lead to Serialization headaches
serialization example, GOTCHA #17 Versioning may lead to Serialization headaches
templates, GOTCHA #12 Compiler warnings may not be benign
transactions in Enterprise Services, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003
Treat Warnings As Errors, GOTCHA #12 Compiler warnings may not be benign
unboxing in MSIL translated from, GOTCHA #9 Typeless ArrayList isn’t type-safe
C++, GOTCHA #65 Release of COM object is confusing
forgetting to call Release(), GOTCHA #65 Release of COM object is confusing
case sensitivity in names, IN A NUTSHELL
casting code, GOTCHA #42 Runtime Type Identification can hurt extensibility
Catch, IN A NUTSHELL, GOTCHA #13 Ordering of catch processing isn’t consist across languages, GOTCHA #13 Ordering of catch processing isn’t consist across languages
inconsistent ordering, IN A NUTSHELL
order, GOTCHA #13 Ordering of catch processing isn’t consist across languages
reversing order of, GOTCHA #13 Ordering of catch processing isn’t consist across languages
catching exception after call to EndInvoke(), GOTCHA #61 Exceptions thrown from threads in the pool are lost
Clark, Jason, Test Driven Development
classes, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #24 Clone() has limitations, IN A NUTSHELL
exposing functionality through, IN A NUTSHELL
with different relationships with its contents, GOTCHA #23 Copy Constructor hampers exensibility
with identifier, GOTCHA #24 Clone() has limitations
ClassInterface options, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes, SEE ALSO, GOTCHA #72 All but one of the ClassInterface options are ineffective, GOTCHA #72 All but one of the ClassInterface options are ineffective
AutoDispatch, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes
AutoDual, GOTCHA #72 All but one of the ClassInterface options are ineffective
ClassInterfaceType.None, GOTCHA #72 All but one of the ClassInterface options are ineffective
clean up, GOTCHA #40 Implementing IDisposable isn’t enough
right way to, GOTCHA #40 Implementing IDisposable isn’t enough
cleanup, GOTCHA #41 Using the Dispose Design Pattern doesn’t guarantee cleanup
missed, GOTCHA #41 Using the Dispose Design Pattern doesn’t guarantee cleanup
Clone() method, SEE ALSO, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, SEE ALSO
fixing to maintain unique id, GOTCHA #24 Clone() has limitations
limitations, SEE ALSO
problem with readonly and, GOTCHA #24 Clone() has limitations
CLR Profiler - Managed Code Performance Tool web site, On the Web
CLR/Framework gotchas, GOTCHA #1 Type alias size doesn’t match what you’re familiar with, GOTCHA #1 Type alias size doesn’t match what you’re familiar with, IN A NUTSHELL
struct - class anomaly, IN A NUTSHELL
type aliases mismatch, GOTCHA #1 Type alias size doesn’t match what you’re familiar with
CLS compliance, GOTCHA #1 Type alias size doesn’t match what you’re familiar with, GOTCHA #30 Common Language Specification Compliance isn’t the default, GOTCHA #30 Common Language Specification Compliance isn’t the default
CLSCompliant attribute, IN A NUTSHELL
CoCreateInstance(), IN A NUTSHELL
COM, IN A NUTSHELL, IN A NUTSHELL, GOTCHA #73 Simply tur ning the switch for COM interop is dangerous, GOTCHA #73 Simply tur ning the switch for COM interop is dangerous
.NET capabilities not supported by, IN A NUTSHELL
exposing public classes for, IN A NUTSHELL
façades and, GOTCHA #73 Simply tur ning the switch for COM interop is dangerous
wrapper classes and, GOTCHA #73 Simply tur ning the switch for COM interop is dangerous
COM component, SEE ALSO
working with multiple interfaces of, SEE ALSO
COM components, GOTCHA #16 Default of Option Strict (off) isn’t good, GOTCHA #66 Using interface pointers after calling ReleaseComObject() will fail, GOTCHA #70 Spattering access to COM components makes code hard to maintain, GOTCHA #70 Spattering access to COM components makes code hard to maintain, IN A NUTSHELL
interacting with, GOTCHA #70 Spattering access to COM components makes code hard to maintain
isolating access to, GOTCHA #70 Spattering access to COM components makes code hard to maintain
multiple interfaces, GOTCHA #66 Using interface pointers after calling ReleaseComObject() will fail
preventing access, IN A NUTSHELL
scripting, GOTCHA #16 Default of Option Strict (off) isn’t good
COM Interop, GOTCHA #65 Release of COM object is confusing, GOTCHA #73 Simply tur ning the switch for COM interop is dangerous
improperly exposing assembly for, GOTCHA #73 Simply tur ning the switch for COM interop is dangerous
COM interoperability, GOTCHA #65 Release of COM object is confusing
exposing .NET object for, GOTCHA #65 Release of COM object is confusing
COM objects, GOTCHA #65 Release of COM object is confusing
problem releasing, GOTCHA #65 Release of COM object is confusing
COM Registration information for .NET component, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes
commit, safely communicating intent to, GOTCHA #75 AutoComplete comes with undesirable side effects
Common Language Infrastructure (CLI), GOTCHA #30 Common Language Specification Compliance isn’t the default
Common Language Specification (CLS), GOTCHA #1 Type alias size doesn’t match what you’re familiar with
Common Object Operations web site, On the Web
Common Type System (CTS), GOTCHA #30 Common Language Specification Compliance isn’t the default
compiler warnings, GOTCHA #12 Compiler warnings may not be benign
compiler, configuring, GOTCHA #12 Compiler warnings may not be benign
components, GOTCHA #16 Default of Option Strict (off) isn’t good
late binding to communicate with, GOTCHA #16 Default of Option Strict (off) isn’t good
COMVisible(false) attribute, IN A NUTSHELL
concurrency, GOTCHA #57 Locking on globally visible objects is too sweeping
constructors of class, making protected or private, GOTCHA #20 Singleton isn’t guaranteed process-wide
CookieContainer property, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, IN A NUTSHELL
copy constructor, IN A NUTSHELL, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, IN A NUTSHELL
deep copy, GOTCHA #23 Copy Constructor hampers exensibility
extensibility of, IN A NUTSHELL
public, IN A NUTSHELL
shallow copy, GOTCHA #23 Copy Constructor hampers exensibility
copy constructor, writing, GOTCHA #23 Copy Constructor hampers exensibility
copy constructors, IN A NUTSHELL
public, IN A NUTSHELL
copying incorrectly, GOTCHA #23 Copy Constructor hampers exensibility
crashes, IN A NUTSHELL
Cruise Control .NET web site, On the Web
CTS types and aliases in VB.NET, GOTCHA #1 Type alias size doesn’t match what you’re familiar with

D

Data.ReadXML, GOTCHA #21 Default performance of Data.ReadXMLData.ReadXML
deadlock, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc
deep copy, GOTCHA #23 Copy Constructor hampers exensibility
delegate, GOTCHA #7 Uninitialized event handlers aren’t treated gracefully, IN A NUTSHELL, GOTCHA #59 Threads invoked using delegates behave like background threads
accessing uninitialized, GOTCHA #7 Uninitialized event handlers aren’t treated gracefully
checking for an uninitialized, IN A NUTSHELL
using to call methods in another thread, GOTCHA #59 Threads invoked using delegates behave like background threads
Delegate class, IN A NUTSHELL
BeginInvoke() and EndInvoke() methods, IN A NUTSHELL
Derived class, GOTCHA #25 Access to static/Shared members isn’t enforced consistently
derived classes, IN A NUTSHELL, IN A NUTSHELL
changing signatures in, IN A NUTSHELL
overridden methods in, IN A NUTSHELL
deriving a C# class from a VB.NET class, GOTCHA #31 Optional parameters break interoperability
deriving a VB.NET class from a C# class, GOTCHA #31 Optional parameters break interoperability
deserialization, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches
handling an exception during, GOTCHA #17 Versioning may lead to Serialization headaches
of a derived class, GOTCHA #17 Versioning may lead to Serialization headaches
Design Guidelines for Class Library Developers web site, C# Language Specification
destructor, Garbage Collection Gotchas
Dispose design pattern, GOTCHA #40 Implementing IDisposable isn’t enough, IN A NUTSHELL
Dispose Design Pattern, Implementing Finalize and Dispose to Clean Up Unmanaged Resources
Dispose() method, IN A NUTSHELL, GOTCHA #40 Implementing IDisposable isn’t enough, GOTCHA #40 Implementing IDisposable isn’t enough, GOTCHA #40 Implementing IDisposable isn’t enough
freeing unmanaged resources, GOTCHA #40 Implementing IDisposable isn’t enough
refactoring, GOTCHA #40 Implementing IDisposable isn’t enough
ReleaseComObject() and, IN A NUTSHELL
what code to write in, GOTCHA #40 Implementing IDisposable isn’t enough
Dispose(bool disposing) method, GOTCHA #40 Implementing IDisposable isn’t enough
disposed objects, suppressing finalization of, SEE ALSO
Don’t Lock Type Objects! web site, C# Language Specification
Draco.NET web site, C# Language Specification

E

ECMA-CLI web site, C# Language Specification
EndInvoke(), catching exception after call to, GOTCHA #61 Exceptions thrown from threads in the pool are lost
Enterprise Services, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003, GOTCHA #75 AutoComplete comes with undesirable side effects
AutoComplete attribute, GOTCHA #75 AutoComplete comes with undesirable side effects
enum, IN A NUTSHELL, IN A NUTSHELL, GOTCHA #22 enum lacks type-safety
example to study type safety of, IN A NUTSHELL
type-safe usage of, GOTCHA #22 enum lacks type-safety
type-safety and, IN A NUTSHELL
Enum.IsDefined(), GOTCHA #22 enum lacks type-safety
Equals vs. == web site, C# Language Specification
events, GOTCHA #64 Raising events lacks thread-safety
raising in thread-safe environment, GOTCHA #64 Raising events lacks thread-safety
exceptions, GOTCHA #6 Exceptions may go unhandled, GOTCHA #6 Exceptions may go unhandled, GOTCHA #6 Exceptions may go unhandled, GOTCHA #6 Exceptions may go unhandled, SEE ALSO, IN A NUTSHELL, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost
catching exception after call to EndInvoke(), GOTCHA #61 Exceptions thrown from threads in the pool are lost
handling and substitutability, IN A NUTSHELL
lost, GOTCHA #61 Exceptions thrown from threads in the pool are lost
method, GOTCHA #46 Exception handling can break polymorphism
method that throws, GOTCHA #46 Exception handling can break polymorphism
that goes unhandled, GOTCHA #6 Exceptions may go unhandled, GOTCHA #6 Exceptions may go unhandled, GOTCHA #6 Exceptions may go unhandled, GOTCHA #6 Exceptions may go unhandled
C# client, GOTCHA #6 Exceptions may go unhandled
C# library, GOTCHA #6 Exceptions may go unhandled
VB.NET client, GOTCHA #6 Exceptions may go unhandled
VB.NET library, GOTCHA #6 Exceptions may go unhandled
unhandled, GOTCHA #61 Exceptions thrown from threads in the pool are lost
useful hidden messages, SEE ALSO
executing thread for different Timers and Delegate, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous
C#, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous
VB.NET, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous
Exit() behavior, SEE ALSO
exiting threads, SEE ALSO
Exploring the Singleton Design Pattern web site, C# Language Specification
exposing .NET component, COM-Interop and Enterprise Services Gotchas, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes, GOTCHA #72 All but one of the ClassInterface options are ineffective, GOTCHA #72 All but one of the ClassInterface options are ineffective
for COM interoperability, COM-Interop and Enterprise Services Gotchas
using AutoDispatch, GOTCHA #72 All but one of the ClassInterface options are ineffective
using GUID attribute, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes
exposing functionality through interfaces instead of classes, IN A NUTSHELL
exposing public classes for COM, IN A NUTSHELL
expressing method exceptions, GOTCHA #46 Exception handling can break polymorphism
extensibility and RTTI, GOTCHA #42 Runtime Type Identification can hurt extensibility

F

façades, GOTCHA #73 Simply tur ning the switch for COM interop is dangerous
FCL (framework class library), GOTCHA #34 Defining an array isn’t consistent
Finalize() method, SEE ALSO, SEE ALSO, GOTCHA #35 Writing Finalize() is rarely a good idea, GOTCHA #35 Writing Finalize() is rarely a good idea, IN A NUTSHELL, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc, IN A NUTSHELL, GOTCHA #37 Rules to invoke base.Finalize() aren’t consistent, IN A NUTSHELL, IN A NUTSHELL, SEE ALSO, SEE ALSO, GOTCHA #40 Implementing IDisposable isn’t enough, GOTCHA #40 Implementing IDisposable isn’t enough, GOTCHA #40 Implementing IDisposable isn’t enough
C# versus VB.NET, SEE ALSO
calling on base class, IN A NUTSHELL
eliminating overhead of calling, SEE ALSO
freeing unmanaged resources, GOTCHA #40 Implementing IDisposable isn’t enough
inadvertently locking from within, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc
main reason for implementing, IN A NUTSHELL
managed resources in, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc
Notify() method and, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc
refactoring, GOTCHA #40 Implementing IDisposable isn’t enough
ReleaseComObject() and, IN A NUTSHELL
suppressing call, SEE ALSO
VB.NET, GOTCHA #37 Rules to invoke base.Finalize() aren’t consistent
what code to put inside, GOTCHA #40 Implementing IDisposable isn’t enough
whether to use, GOTCHA #35 Writing Finalize() is rarely a good idea
writing in VB.NET, IN A NUTSHELL
finally blocks, IN A NUTSHELL
floating point division by zero, GOTCHA #8 Division operation isn’t consistent between types
form controls and thread safety, IN A NUTSHELL
FxCop, GOTCHA #1 Type alias size doesn’t match what you’re familiar with, IN A NUTSHELL, Gotdotnet
web site, Gotdotnet

G

garbage collection, Garbage Collection Gotchas, GOTCHA #41 Using the Dispose Design Pattern doesn’t guarantee cleanup
missed cleanup, GOTCHA #41 Using the Dispose Design Pattern doesn’t guarantee cleanup
Garbage Collection web site, Garbage Collection
GC class’s WaitForPendingFinalizers() method, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc
GC.Collect(), GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc
GC.SuppressFinalize(), SEE ALSO
GetObjectData() method, GOTCHA #17 Versioning may lead to Serialization headaches
GetType(), GOTCHA #10 Type.GetType() may not locate all types, GOTCHA #10 Type.GetType() may not locate all types, SEE ALSO, SEE ALSO, GOTCHA #56 Calling Type.GetType() may not return what you expect, IN A NUTSHELL
behavior of, GOTCHA #10 Type.GetType() may not locate all types
correct usage of, GOTCHA #10 Type.GetType() may not locate all types
failure, SEE ALSO
not type safe, SEE ALSO
problem with instance’s, GOTCHA #56 Calling Type.GetType() may not return what you expect
Gotdotnet web site, Garbage Collection
Groups @ Google web site, Garbage Collection
GUID, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes
effect of change in version number on generated, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes
generating, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes
problems with automatic generation, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes

L

language interoperability, GOTCHA #30 Common Language Specification Compliance isn’t the default, GOTCHA #31 Optional parameters break interoperability, IN A NUTSHELL, IN A NUTSHELL, GOTCHA #34 Defining an array isn’t consistent
inconsistent array allocation, GOTCHA #34 Defining an array isn’t consistent
names and case sensitivity, IN A NUTSHELL
names, avoiding conflicts, IN A NUTSHELL
optional parameters, GOTCHA #31 Optional parameters break interoperability
languages available in .NET web site, Garbage Collection
late binding to communicate with component, IN A NUTSHELL
Liskov’s Substitution Principle (LSP), GOTCHA #46 Exception handling can break polymorphism
locking right metadata, GOTCHA #56 Calling Type.GetType() may not return what you expect
locking type metadata, IN A NUTSHELL
lost exception in asynchronous call, GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost
Web service, GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost
C#, GOTCHA #61 Exceptions thrown from threads in the pool are lost
VB.NET, GOTCHA #61 Exceptions thrown from threads in the pool are lost
Web service client, GOTCHA #61 Exceptions thrown from threads in the pool are lost
C#, GOTCHA #61 Exceptions thrown from threads in the pool are lost
LSP, violation of, GOTCHA #46 Exception handling can break polymorphism

M

Main() method, changing apartment of, GOTCHA #67 Cross-apartment calls are expensive
MemberwiseClone() method, SEE ALSO, SEE ALSO
readonly fields and, SEE ALSO
memory management, Garbage Collection Gotchas
metadata, GOTCHA #56 Calling Type.GetType() may not return what you expect, IN A NUTSHELL, IN A NUTSHELL
fetching for specific class, IN A NUTSHELL
locking, GOTCHA #56 Calling Type.GetType() may not return what you expect
locking type, IN A NUTSHELL
methods, IN A NUTSHELL, IN A NUTSHELL, IN A NUTSHELL, GOTCHA #46 Exception handling can break polymorphism, SEE ALSO, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #73 Simply tur ning the switch for COM interop is dangerous
calling with parameter from another thread, SEE ALSO
conflicting names, IN A NUTSHELL
name conflict, IN A NUTSHELL
naming, IN A NUTSHELL
one approach to invoking method with parameter, GOTCHA #60 Passing parameters to threads is tricky
overloading, GOTCHA #73 Simply tur ning the switch for COM interop is dangerous
that throw exception, GOTCHA #46 Exception handling can break polymorphism
Microsoft Intermediate Language (MSIL), CLR/Framework Gotchas
MSDN Magazine web site, MSDN Magazine
MSDN web site, MSDN Magazine
MSIL for TestIt() method, GOTCHA #64 Raising events lacks thread-safety
MSIL translation of a RaiseEvent() statement, GOTCHA #7 Uninitialized event handlers aren’t treated gracefully
MSIL with difference between throw ex and throw, GOTCHA #16 Default of Option Strict (off) isn’t good
MTAThread, effect of not setting in C#, IN A NUTSHELL
multiple calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
on web service, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
C# client side, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
C# server side, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
VB.NET client side, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
VB.NET server side, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
when session is maintained, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
multiple concurrent requests to a web service, IN A NUTSHELL
multiple interfaces, COM components, SEE ALSO
Multithreaded Apartment (MTA), GOTCHA #67 Cross-apartment calls are expensive
multithreading, GOTCHA #48 The Thread classThread class
MyBase.Finalize() method, IN A NUTSHELL
Myers, Bertrand, IN A NUTSHELL

R

RaiseEvent in VB.NET, GOTCHA #64 Raising events lacks thread-safety
RCW (Runtime Callable Wrapper), GOTCHA #65 Release of COM object is confusing
RCW (Wrapper and the Runtime Callable Wrapper), IN A NUTSHELL
readonly and Clone(), problem with, GOTCHA #24 Clone() has limitations
readonly fields, GOTCHA #24 Clone() has limitations, SEE ALSO
MemberwiseClone(), SEE ALSO
ReadXML(), IN A NUTSHELL
refactored Wrapper class, GOTCHA #40 Implementing IDisposable isn’t enough
refactoring Dispose() and Finalize(), GOTCHA #40 Implementing IDisposable isn’t enough
reference type, assignment of, GOTCHA #2 struct and class differ in behavior
reflection to serialize and deserialize, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches
C#, GOTCHA #17 Versioning may lead to Serialization headaches
VB.NET, GOTCHA #17 Versioning may lead to Serialization headaches
Reflector web site, MSDN Magazine
Register for COM interop (project setting), GOTCHA #65 Release of COM object is confusing
Release(), forgetting to call in C++, GOTCHA #65 Release of COM object is confusing
ReleaseComObject(), IN A NUTSHELL, SEE ALSO, IN A NUTSHELL
multiple interfaces and, SEE ALSO
versus IUnknown Release() method, IN A NUTSHELL
ReleaseComObject() method, GOTCHA #38 Depending on Finalize() can tie up critical resources
ReleaseComObject() static/Shared method, IN A NUTSHELL
releasing COM objects, GOTCHA #65 Release of COM object is confusing
Reset() method, GOTCHA #33 Name collision with keywords breaks interoperability
ResetAbort(), GOTCHA #54 ResetAbort() may lead to surprises
resources, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc, GOTCHA #38 Depending on Finalize() can tie up critical resources, GOTCHA #40 Implementing IDisposable isn’t enough
accessing managed, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc
freeing unmanaged, GOTCHA #40 Implementing IDisposable isn’t enough
unmanaged resources from .NET, GOTCHA #38 Depending on Finalize() can tie up critical resources
returning a value type, GOTCHA #3 Returning value types from a method/property is risky
Richter, Jeffrey, GOTCHA #35 Writing Finalize() is rarely a good idea, Garbage Collection
RTTI, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, IN A NUTSHELL
example of use, GOTCHA #42 Runtime Type Identification can hurt extensibility
extensibility and, GOTCHA #42 Runtime Type Identification can hurt extensibility
OCP and, GOTCHA #42 Runtime Type Identification can hurt extensibility
using in Play() method, IN A NUTSHELL

S

scripting COM component, GOTCHA #16 Default of Option Strict (off) isn’t good
serialization, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches
examples, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches
C#, GOTCHA #17 Versioning may lead to Serialization headaches
VB.NET, GOTCHA #17 Versioning may lead to Serialization headaches
of a derived class, GOTCHA #17 Versioning may lead to Serialization headaches
SerializationInfo class, GOTCHA #17 Versioning may lead to Serialization headaches
ServicedComponent, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003
ServicedComponents, IN A NUTSHELL, IN A NUTSHELL
inconsistencies, IN A NUTSHELL
various Windows platforms, IN A NUTSHELL
sessions, multiple calls when session is maintained, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
SetExecutingThreadLabel() method, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous
SetPassword() method, GOTCHA #29 Unit testing private methodstesting private methods
Shadows keyword, IN A NUTSHELL
shallow copy, GOTCHA #23 Copy Constructor hampers exensibility
Shared members, SEE ALSO, SEE ALSO, SEE ALSO
access to, SEE ALSO
invoking usingreference, SEE ALSO
object references and, SEE ALSO
Shared method, GOTCHA #25 Access to static/Shared members isn’t enforced consistently
signatures, SEE ALSO, GOTCHA #47 Signature mismatches can lead to method hiding, GOTCHA #47 Signature mismatches can lead to method hiding, IN A NUTSHELL
changing in derived class, IN A NUTSHELL
mismatches, SEE ALSO, GOTCHA #47 Signature mismatches can lead to method hiding
method hiding, SEE ALSO
overriding and overloading to change, GOTCHA #47 Signature mismatches can lead to method hiding
Single Threaded Apartment (STA), GOTCHA #67 Cross-apartment calls are expensive
singleton, GOTCHA #20 Singleton isn’t guaranteed process-wide, GOTCHA #20 Singleton isn’t guaranteed process-wide, GOTCHA #20 Singleton isn’t guaranteed process-wide
example, GOTCHA #20 Singleton isn’t guaranteed process-wide
not guaranteed process-wide, GOTCHA #20 Singleton isn’t guaranteed process-wide
within AppDomain, GOTCHA #20 Singleton isn’t guaranteed process-wide
Singleton Design Pattern, Exploring the Singleton Design Pattern
Singleton thread-safety, Implementing the Singleton Pattern in C#
sn utility to create key and extract public key token, GOTCHA #11 Public key reported by sn.exe is inconsistent
solutions versus projects, IN A NUTSHELL
Start() method, GOTCHA #33 Name collision with keywords breaks interoperability
STAThread, IN A NUTSHELL, GOTCHA #69 STAThread attribute may have no effect on your methods, GOTCHA #69 STAThread attribute may have no effect on your methods
effect of not setting in C#, IN A NUTSHELL
effect of using, GOTCHA #69 STAThread attribute may have no effect on your methods
usage, GOTCHA #69 STAThread attribute may have no effect on your methods
static variables, GOTCHA #73 Simply tur ning the switch for COM interop is dangerous
static/Shared fields, GOTCHA #20 Singleton isn’t guaranteed process-wide, IN A NUTSHELL
uniquess of, IN A NUTSHELL
static/Shared methods, SEE ALSO, IN A NUTSHELL, GOTCHA #57 Locking on globally visible objects is too sweeping
synchronization, IN A NUTSHELL
static/shared methods, IN A NUTSHELL
polymorphism, IN A NUTSHELL
Stop() method, GOTCHA #33 Name collision with keywords breaks interoperability, IN A NUTSHELL
Strict option off, IN A NUTSHELL
StringBuilder versus +/&, IN A NUTSHELL
struct keyword in C#, GOTCHA #2 struct and class differ in behavior
Structure in VB.NET, GOTCHA #2 struct and class differ in behavior
synchronization, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect
ineffective, GOTCHA #56 Calling Type.GetType() may not return what you expect
problems with, GOTCHA #56 Calling Type.GetType() may not return what you expect
synchronizing, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #57 Locking on globally visible objects is too sweeping
locally and precisely, GOTCHA #57 Locking on globally visible objects is too sweeping
on metadata, GOTCHA #56 Calling Type.GetType() may not return what you expect
SyncLock block, GOTCHA #64 Raising events lacks thread-safety
System.Data.DataSet class, IN A NUTSHELL
System.Enum.IsDefined(), GOTCHA #22 enum lacks type-safety
System.ICloneable interface, SEE ALSO
System.Runtime.InteropServices.Marshal class, GOTCHA #38 Depending on Finalize() can tie up critical resources
System.Runtime.InteropServices.Marshal.ReleaseComObject() static/Shared method, IN A NUTSHELL
System.Timers.Timer object, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous
System.Timers.Timer’s event handler, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous
System.Web.Services.Protocols.SoapException, GOTCHA #61 Exceptions thrown from threads in the pool are lost
System.Windows.Forms.Control.Invoke() method, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous, IN A NUTSHELL
System.Xml.XmlDocument parser class, GOTCHA #21 Default performance of Data.ReadXMLData.ReadXML

T

termination of background thread, GOTCHA #50 Background threads don’t terminate gracefully
Test class, GOTCHA #64 Raising events lacks thread-safety
Test Driven Development web site, Test Driven Development
testing private methods, GOTCHA #29 Unit testing private methodstesting private methods
Thread class, GOTCHA #48 The Thread classThread class, GOTCHA #48 The Thread classThread class, IN A NUTSHELL, IN A NUTSHELL, IN A NUTSHELL, IN A NUTSHELL, IN A NUTSHELL, IN A NUTSHELL, IN A NUTSHELL, IN A NUTSHELL, IN A NUTSHELL, IN A NUTSHELL, IN A NUTSHELL, IN A NUTSHELL, IN A NUTSHELL, SEE ALSO, GOTCHA #54 ResetAbort() may lead to surprises, IN A NUTSHELL
Abort(), IN A NUTSHELL
Abort() behavior, IN A NUTSHELL
Abort() method, IN A NUTSHELL, IN A NUTSHELL
calling Join() method after, IN A NUTSHELL
dangerous methods and properties, GOTCHA #48 The Thread classThread class
Exit() method, SEE ALSO
Interrupt() method, IN A NUTSHELL
IsAlive property, IN A NUTSHELL
IsBackground property, IN A NUTSHELL
Join(), IN A NUTSHELL
Pulse(), IN A NUTSHELL
ResetAbort() method, IN A NUTSHELL, GOTCHA #54 ResetAbort() may lead to surprises
Resume() method, IN A NUTSHELL
Suspend() method, IN A NUTSHELL
ThreadState property, IN A NUTSHELL
Wait() method, IN A NUTSHELL
thread pool, GOTCHA #58 Threads from the thread pool are scarce
thread safety, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, IN A NUTSHELL, GOTCHA #64 Raising events lacks thread-safety
form controls, IN A NUTSHELL
parameters, GOTCHA #60 Passing parameters to threads is tricky
raising events in thread-safe environment, GOTCHA #64 Raising events lacks thread-safety
testing, GOTCHA #60 Passing parameters to threads is tricky
thread-safe objects, GOTCHA #67 Cross-apartment calls are expensive
ThreadAbortException, GOTCHA #50 Background threads don’t terminate gracefully, SEE ALSO, GOTCHA #54 ResetAbort() may lead to surprises
ResetAbort() method and, GOTCHA #54 ResetAbort() may lead to surprises
ThreadInterruptedException, GOTCHA #51 Interrupt () kicks in only when a thread is blocked
ThreadRunner class, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky
using, GOTCHA #60 Passing parameters to threads is tricky
threads, IN A NUTSHELL, GOTCHA #49 Foreground threads may prevent a program from terminating, GOTCHA #49 Foreground threads may prevent a program from terminating, GOTCHA #50 Background threads don’t terminate gracefully, GOTCHA #50 Background threads don’t terminate gracefully, IN A NUTSHELL, SEE ALSO, SEE ALSO, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous
abrupt termination of background thread, GOTCHA #50 Background threads don’t terminate gracefully
background, GOTCHA #49 Foreground threads may prevent a program from terminating, GOTCHA #50 Background threads don’t terminate gracefully
terminating, GOTCHA #50 Background threads don’t terminate gracefully
behavior, GOTCHA #49 Foreground threads may prevent a program from terminating
executing thread for different Timers and Delegate, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous
C#, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous
VB.NET, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous
exiting, SEE ALSO
immortal, IN A NUTSHELL
interrupting, IN A NUTSHELL
parameters, GOTCHA #60 Passing parameters to threads is tricky
using your own thread versus one from thread pool, SEE ALSO
throw statement, IN A NUTSHELL, GOTCHA #15 rethrow isn’t consistent, GOTCHA #15 rethrow isn’t consistent
using to propagate an exception, IN A NUTSHELL
Townsend, Mark, C# Language Specification
Trainer class relying on polymorphic behavior of MakeNoise() method, GOTCHA #42 Runtime Type Identification can hurt extensibility
TransactionOption.Required, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003
transactions in Enterprise Services, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003
C#, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003
VB.NET, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003
Treat Warnings As Errors, GOTCHA #12 Compiler warnings may not be benign, GOTCHA #12 Compiler warnings may not be benign
C#, GOTCHA #12 Compiler warnings may not be benign
VB.NET, GOTCHA #12 Compiler warnings may not be benign
try/catch statements, GOTCHA #42 Runtime Type Identification can hurt extensibility
type aliases mismatch, GOTCHA #1 Type alias size doesn’t match what you’re familiar with
Type metadata, GOTCHA #14 Type.GetType() might fail at run-time, GOTCHA #57 Locking on globally visible objects is too sweeping
locking, GOTCHA #57 Locking on globally visible objects is too sweeping
type-safe usage of enum, GOTCHA #22 enum lacks type-safety
Type.GetType(), GOTCHA #10 Type.GetType() may not locate all types, SEE ALSO, SEE ALSO
behavior of, GOTCHA #10 Type.GetType() may not locate all types
failure, SEE ALSO
not type safe, SEE ALSO
typeof/GetType operator, IN A NUTSHELL

V

value type, GOTCHA #3 Returning value types from a method/property is risky, GOTCHA #3 Returning value types from a method/property is risky, GOTCHA #4 You can’t force calls to your value-type constructors
no-parameter constructor of, GOTCHA #4 You can’t force calls to your value-type constructors
returned from a property, modifying, GOTCHA #3 Returning value types from a method/property is risky
returning, GOTCHA #3 Returning value types from a method/property is risky
VB FAQs web site, Test Driven Development
VB.NET, GOTCHA #1 Type alias size doesn’t match what you’re familiar with, GOTCHA #1 Type alias size doesn’t match what you’re familiar with, GOTCHA #2 struct and class differ in behavior, GOTCHA #3 Returning value types from a method/property is risky, GOTCHA #3 Returning value types from a method/property is risky, GOTCHA #4 You can’t force calls to your value-type constructors, GOTCHA #5 String concatenation is expensive, GOTCHA #6 Exceptions may go unhandled, GOTCHA #6 Exceptions may go unhandled, GOTCHA #6 Exceptions may go unhandled, GOTCHA #7 Uninitialized event handlers aren’t treated gracefully, GOTCHA #8 Division operation isn’t consistent between types, GOTCHA #8 Division operation isn’t consistent between types, GOTCHA #9 Typeless ArrayList isn’t type-safe, GOTCHA #9 Typeless ArrayList isn’t type-safe, GOTCHA #9 Typeless ArrayList isn’t type-safe, GOTCHA #9 Typeless ArrayList isn’t type-safe, GOTCHA #10 Type.GetType() may not locate all types, GOTCHA #10 Type.GetType() may not locate all types, GOTCHA #12 Compiler warnings may not be benign, GOTCHA #12 Compiler warnings may not be benign, GOTCHA #12 Compiler warnings may not be benign, GOTCHA #12 Compiler warnings may not be benign, GOTCHA #13 Ordering of catch processing isn’t consist across languages, GOTCHA #13 Ordering of catch processing isn’t consist across languages, IN A NUTSHELL, GOTCHA #14 Type.GetType() might fail at run-time, GOTCHA #14 Type.GetType() might fail at run-time, GOTCHA #15 rethrow isn’t consistent, GOTCHA #16 Default of Option Strict (off) isn’t good, GOTCHA #16 Default of Option Strict (off) isn’t good, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #20 Singleton isn’t guaranteed process-wide, GOTCHA #20 Singleton isn’t guaranteed process-wide, GOTCHA #21 Default performance of Data.ReadXMLData.ReadXML, GOTCHA #22 enum lacks type-safety, GOTCHA #22 enum lacks type-safety, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #26 Details of exception may be hidden, GOTCHA #26 Details of exception may be hidden, GOTCHA #27 Object initialization sequence isn’t consistent, GOTCHA #28 Polymorphism kicks in prematurely, GOTCHA #29 Unit testing private methodstesting private methods, GOTCHA #29 Unit testing private methodstesting private methods, SEE ALSO, GOTCHA #31 Optional parameters break interoperability, GOTCHA #31 Optional parameters break interoperability, GOTCHA #31 Optional parameters break interoperability, GOTCHA #32 Mixing case between class members breaks interoperability, IN A NUTSHELL, GOTCHA #33 Name collision with keywords breaks interoperability, GOTCHA #33 Name collision with keywords breaks interoperability, GOTCHA #34 Defining an array isn’t consistent, GOTCHA #34 Defining an array isn’t consistent, GOTCHA #34 Defining an array isn’t consistent, IN A NUTSHELL, GOTCHA #35 Writing Finalize() is rarely a good idea, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc, IN A NUTSHELL, IN A NUTSHELL, GOTCHA #38 Depending on Finalize() can tie up critical resources, GOTCHA #39 Using Finalize() on disposed objects is costly, GOTCHA #40 Implementing IDisposable isn’t enough, GOTCHA #40 Implementing IDisposable isn’t enough, GOTCHA #40 Implementing IDisposable isn’t enough, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #43 Using new/shadows causes “hideous hiding”, GOTCHA #44 Compilers are lenient toward forgotten override/overrides, GOTCHA #45 Compilers lean toward hiding virtual methods, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #47 Signature mismatches can lead to method hiding, GOTCHA #47 Signature mismatches can lead to method hiding, GOTCHA #49 Foreground threads may prevent a program from terminating, GOTCHA #50 Background threads don’t terminate gracefully, GOTCHA #51 Interrupt () kicks in only when a thread is blocked, GOTCHA #52 ThreadAbortException—a hot potato, GOTCHA #53 Environment.Exit() brings down the CLR, GOTCHA #54 ResetAbort() may lead to surprises, GOTCHA #55 Abort() takes time to clean up, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #57 Locking on globally visible objects is too sweeping, GOTCHA #57 Locking on globally visible objects is too sweeping, GOTCHA #59 Threads invoked using delegates behave like background threads, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #64 Raising events lacks thread-safety, GOTCHA #64 Raising events lacks thread-safety, GOTCHA #65 Release of COM object is confusing, GOTCHA #66 Using interface pointers after calling ReleaseComObject() will fail, GOTCHA #67 Cross-apartment calls are expensive, GOTCHA #67 Cross-apartment calls are expensive, GOTCHA #68 Default apartment of main thread is inconsistent across languages, GOTCHA #69 STAThread attribute may have no effect on your methods, GOTCHA #69 STAThread attribute may have no effect on your methods, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes, GOTCHA #72 All but one of the ClassInterface options are ineffective, GOTCHA #72 All but one of the ClassInterface options are ineffective, GOTCHA #72 All but one of the ClassInterface options are ineffective, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003, GOTCHA #75 AutoComplete comes with undesirable side effects, GOTCHA #75 AutoComplete comes with undesirable side effects
Catch order, IN A NUTSHELL
class derived from another class, GOTCHA #33 Name collision with keywords breaks interoperability
code examples, GOTCHA #1 Type alias size doesn’t match what you’re familiar with, GOTCHA #1 Type alias size doesn’t match what you’re familiar with, GOTCHA #2 struct and class differ in behavior, GOTCHA #3 Returning value types from a method/property is risky, GOTCHA #3 Returning value types from a method/property is risky, GOTCHA #4 You can’t force calls to your value-type constructors, GOTCHA #5 String concatenation is expensive, GOTCHA #6 Exceptions may go unhandled, GOTCHA #6 Exceptions may go unhandled, GOTCHA #6 Exceptions may go unhandled, GOTCHA #7 Uninitialized event handlers aren’t treated gracefully, GOTCHA #8 Division operation isn’t consistent between types, GOTCHA #8 Division operation isn’t consistent between types, GOTCHA #9 Typeless ArrayList isn’t type-safe, GOTCHA #9 Typeless ArrayList isn’t type-safe, GOTCHA #9 Typeless ArrayList isn’t type-safe, GOTCHA #10 Type.GetType() may not locate all types, GOTCHA #10 Type.GetType() may not locate all types, GOTCHA #12 Compiler warnings may not be benign, GOTCHA #12 Compiler warnings may not be benign, GOTCHA #13 Ordering of catch processing isn’t consist across languages, GOTCHA #13 Ordering of catch processing isn’t consist across languages, GOTCHA #14 Type.GetType() might fail at run-time, GOTCHA #14 Type.GetType() might fail at run-time, GOTCHA #15 rethrow isn’t consistent, GOTCHA #16 Default of Option Strict (off) isn’t good, GOTCHA #16 Default of Option Strict (off) isn’t good, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #20 Singleton isn’t guaranteed process-wide, GOTCHA #20 Singleton isn’t guaranteed process-wide, GOTCHA #21 Default performance of Data.ReadXMLData.ReadXML, GOTCHA #22 enum lacks type-safety, GOTCHA #22 enum lacks type-safety, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #26 Details of exception may be hidden, GOTCHA #26 Details of exception may be hidden, GOTCHA #27 Object initialization sequence isn’t consistent, GOTCHA #28 Polymorphism kicks in prematurely, GOTCHA #29 Unit testing private methodstesting private methods, GOTCHA #29 Unit testing private methodstesting private methods, SEE ALSO, GOTCHA #31 Optional parameters break interoperability, GOTCHA #31 Optional parameters break interoperability, GOTCHA #32 Mixing case between class members breaks interoperability, IN A NUTSHELL, GOTCHA #33 Name collision with keywords breaks interoperability, GOTCHA #34 Defining an array isn’t consistent, GOTCHA #34 Defining an array isn’t consistent, GOTCHA #34 Defining an array isn’t consistent, GOTCHA #35 Writing Finalize() is rarely a good idea, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc, GOTCHA #38 Depending on Finalize() can tie up critical resources, GOTCHA #39 Using Finalize() on disposed objects is costly, GOTCHA #40 Implementing IDisposable isn’t enough, GOTCHA #40 Implementing IDisposable isn’t enough, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #43 Using new/shadows causes “hideous hiding”, GOTCHA #44 Compilers are lenient toward forgotten override/overrides, GOTCHA #45 Compilers lean toward hiding virtual methods, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #47 Signature mismatches can lead to method hiding, GOTCHA #47 Signature mismatches can lead to method hiding, GOTCHA #49 Foreground threads may prevent a program from terminating, GOTCHA #50 Background threads don’t terminate gracefully, GOTCHA #51 Interrupt () kicks in only when a thread is blocked, GOTCHA #52 ThreadAbortException—a hot potato, GOTCHA #53 Environment.Exit() brings down the CLR, GOTCHA #54 ResetAbort() may lead to surprises, GOTCHA #55 Abort() takes time to clean up, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #57 Locking on globally visible objects is too sweeping, GOTCHA #57 Locking on globally visible objects is too sweeping, GOTCHA #59 Threads invoked using delegates behave like background threads, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #64 Raising events lacks thread-safety, GOTCHA #65 Release of COM object is confusing, GOTCHA #66 Using interface pointers after calling ReleaseComObject() will fail, GOTCHA #67 Cross-apartment calls are expensive, GOTCHA #67 Cross-apartment calls are expensive, GOTCHA #68 Default apartment of main thread is inconsistent across languages, GOTCHA #69 STAThread attribute may have no effect on your methods, GOTCHA #69 STAThread attribute may have no effect on your methods, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes, GOTCHA #72 All but one of the ClassInterface options are ineffective, GOTCHA #72 All but one of the ClassInterface options are ineffective, GOTCHA #72 All but one of the ClassInterface options are ineffective, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003, GOTCHA #75 AutoComplete comes with undesirable side effects, GOTCHA #75 AutoComplete comes with undesirable side effects
Abort, GOTCHA #52 ThreadAbortException—a hot potato
Aliases, GOTCHA #1 Type alias size doesn’t match what you’re familiar with, GOTCHA #1 Type alias size doesn’t match what you’re familiar with
Apartment, GOTCHA #67 Cross-apartment calls are expensive, GOTCHA #67 Cross-apartment calls are expensive
Array, GOTCHA #34 Defining an array isn’t consistent, GOTCHA #34 Defining an array isn’t consistent, GOTCHA #34 Defining an array isn’t consistent
ArrayList, GOTCHA #9 Typeless ArrayList isn’t type-safe, GOTCHA #9 Typeless ArrayList isn’t type-safe, GOTCHA #9 Typeless ArrayList isn’t type-safe
BackgroundAbort, GOTCHA #50 Background threads don’t terminate gracefully
BeginInvoke, GOTCHA #59 Threads invoked using delegates behave like background threads
CatchOrder, GOTCHA #13 Ordering of catch processing isn’t consist across languages, GOTCHA #13 Ordering of catch processing isn’t consist across languages
ClassInterfaceType, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes, GOTCHA #72 All but one of the ClassInterface options are ineffective, GOTCHA #72 All but one of the ClassInterface options are ineffective, GOTCHA #72 All but one of the ClassInterface options are ineffective
COMInterfaces, GOTCHA #66 Using interface pointers after calling ReleaseComObject() will fail
ControlThread, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous
CopyingObjects, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #23 Copy Constructor hampers exensibility, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations, GOTCHA #24 Clone() has limitations
DataSetXMLSpeed, GOTCHA #21 Default performance of Data.ReadXMLData.ReadXML
DefaultApartment, GOTCHA #68 Default apartment of main thread is inconsistent across languages
Delegate, GOTCHA #7 Uninitialized event handlers aren’t treated gracefully
DifferInCase, GOTCHA #32 Mixing case between class members breaks interoperability
DisposeFinalize, GOTCHA #40 Implementing IDisposable isn’t enough
DivByZero, GOTCHA #8 Division operation isn’t consistent between types, GOTCHA #8 Division operation isn’t consistent between types
EnumSafety, GOTCHA #22 enum lacks type-safety, GOTCHA #22 enum lacks type-safety
ES, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003
ESAutoComplete, GOTCHA #75 AutoComplete comes with undesirable side effects, GOTCHA #75 AutoComplete comes with undesirable side effects
ExceptionInDeriving, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism, GOTCHA #46 Exception handling can break polymorphism
ExceptionInThread, client-side code, GOTCHA #61 Exceptions thrown from threads in the pool are lost , GOTCHA #61 Exceptions thrown from threads in the pool are lost
ExceptionInThread, server-side code, GOTCHA #61 Exceptions thrown from threads in the pool are lost
Finalize, GOTCHA #35 Writing Finalize() is rarely a good idea
GetType, GOTCHA #10 Type.GetType() may not locate all types, GOTCHA #10 Type.GetType() may not locate all types
GUID, GOTCHA #71 Auto-generating GUID for your classes leads to versioning woes
HandleException, GOTCHA #6 Exceptions may go unhandled
HandleException, client code, GOTCHA #6 Exceptions may go unhandled
HandleException, library code, GOTCHA #6 Exceptions may go unhandled
HidingMess, GOTCHA #43 Using new/shadows causes “hideous hiding”
Initialization, GOTCHA #27 Object initialization sequence isn’t consistent
Interrupt, GOTCHA #51 Interrupt () kicks in only when a thread is blocked
IsBackground, GOTCHA #49 Foreground threads may prevent a program from terminating
JoinAbort, GOTCHA #55 Abort() takes time to clean up
KnowTheExit, GOTCHA #53 Environment.Exit() brings down the CLR
MethodSignature, GOTCHA #47 Signature mismatches can lead to method hiding, GOTCHA #47 Signature mismatches can lead to method hiding
MultipleWSCalls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
MultipleWSCalls, client side, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
MultipleWSCalls, server side, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
No Example in VB.NET, GOTCHA #12 Compiler warnings may not be benign
NotToFinalize, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc, GOTCHA #36 Releasing managed resources in Finalize() can wreak havoc
Optional, SEE ALSO, GOTCHA #31 Optional parameters break interoperability, GOTCHA #31 Optional parameters break interoperability
OptionStrict, GOTCHA #16 Default of Option Strict (off) isn’t good, GOTCHA #16 Default of Option Strict (off) isn’t good
ParamThreadSafety, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky, GOTCHA #60 Passing parameters to threads is tricky
PolymorphismTooSoon, GOTCHA #28 Polymorphism kicks in prematurely
RaisingEventThreadSafety, GOTCHA #64 Raising events lacks thread-safety
RefactoredWrapper, GOTCHA #40 Implementing IDisposable isn’t enough
ReflectionToSerialize, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches, GOTCHA #17 Versioning may lead to Serialization headaches
RememberMarkOverride, GOTCHA #44 Compilers are lenient toward forgotten override/overrides
ResetAbortMethod, GOTCHA #54 ResetAbort() may lead to surprises
ResourceHold, GOTCHA #38 Depending on Finalize() can tie up critical resources
Rethrow, GOTCHA #15 rethrow isn’t consistent
ReturningValueType, GOTCHA #3 Returning value types from a method/property is risky, GOTCHA #3 Returning value types from a method/property is risky
RTTI, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility, GOTCHA #42 Runtime Type Identification can hurt extensibility
SettingApartment, GOTCHA #69 STAThread attribute may have no effect on your methods, GOTCHA #69 STAThread attribute may have no effect on your methods
SingletonAppDomain, GOTCHA #20 Singleton isn’t guaranteed process-wide, GOTCHA #20 Singleton isn’t guaranteed process-wide
StringAppend, GOTCHA #5 String concatenation is expensive
SuppressingFinalize, GOTCHA #39 Using Finalize() on disposed objects is costly
Synchronizing, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect, GOTCHA #56 Calling Type.GetType() may not return what you expect
SynchWithIntent, GOTCHA #57 Locking on globally visible objects is too sweeping, GOTCHA #57 Locking on globally visible objects is too sweeping
TestPrivate, GOTCHA #29 Unit testing private methodstesting private methods, GOTCHA #29 Unit testing private methodstesting private methods
ThouShaltReleaseObject, GOTCHA #65 Release of COM object is confusing
Typeof, GOTCHA #14 Type.GetType() might fail at run-time, GOTCHA #14 Type.GetType() might fail at run-time
ValueReferenceTypes, GOTCHA #2 struct and class differ in behavior
ValueTypeConstructor, GOTCHA #4 You can’t force calls to your value-type constructors
VirtualInDerived, GOTCHA #45 Compilers lean toward hiding virtual methods
Warnings, GOTCHA #12 Compiler warnings may not be benign
WhatsInAName, IN A NUTSHELL, GOTCHA #33 Name collision with keywords breaks interoperability
XMLSerializer, GOTCHA #26 Details of exception may be hidden, GOTCHA #26 Details of exception may be hidden
communicating with root object, GOTCHA #74 ServicedComponents implemented inconsistently on XP and 2003
creating arrays, IN A NUTSHELL
deriving a VB.NET class from a C# class, GOTCHA #31 Optional parameters break interoperability
Dispose design pattern, GOTCHA #40 Implementing IDisposable isn’t enough
executing thread for different Timers and Delegate, GOTCHA #62 Accessing WinForm controls from arbitrary threads is dangerous
Finalize(), writing as Protected Overrides method, IN A NUTSHELL
lost exception in asynchronous call, Web service, GOTCHA #61 Exceptions thrown from threads in the pool are lost
multiple calls on web service, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
client side, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
server side, GOTCHA #63 Web-service proxy may fail when used for multiple asynchronous calls
RaiseEvent, GOTCHA #64 Raising events lacks thread-safety
reflection to serialize and deserialize, GOTCHA #17 Versioning may lead to Serialization headaches
serialization example, GOTCHA #17 Versioning may lead to Serialization headaches
templates, GOTCHA #12 Compiler warnings may not be benign
Treat Warnings As Errors, GOTCHA #12 Compiler warnings may not be benign
unboxing in MSIL translated from, GOTCHA #9 Typeless ArrayList isn’t type-safe
writing Finalize(), IN A NUTSHELL
VB6, GOTCHA #65 Release of COM object is confusing
setting reference to Nothing, GOTCHA #65 Release of COM object is confusing
versioning, GOTCHA #17 Versioning may lead to Serialization headaches
violation of LSP, GOTCHA #46 Exception handling can break polymorphism
virtual/overridable methods, GOTCHA #24 Clone() has limitations, GOTCHA #28 Polymorphism kicks in prematurely, SEE ALSO, GOTCHA #43 Using new/shadows causes “hideous hiding”, IN A NUTSHELL, GOTCHA #45 Compilers lean toward hiding virtual methods, GOTCHA #47 Signature mismatches can lead to method hiding
calling inside constructors, SEE ALSO
polymorphism and, GOTCHA #28 Polymorphism kicks in prematurely
with same name and signature exists in base class, GOTCHA #45 Compilers lean toward hiding virtual methods
Visual Source Safe (VSS), GOTCHA #18 Creating Web apps can be painful
Visual Studio, Visual Studio and Compiler Gotchas, GOTCHA #12 Compiler warnings may not be benign
warnings reported by, GOTCHA #12 Compiler warnings may not be benign
Visual Studio debugger, GOTCHA #64 Raising events lacks thread-safety
Disassembly, GOTCHA #64 Raising events lacks thread-safety
VS.NET tips and tricks web site, Test Driven Development
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.56.233