'#End ExternalSource' must be preceded by a matching '#ExternalSource'

The #ExternalSource directive references outside code, enabling the compiler to accurately report when exceptions occur within that code. An #ExternalSource block must begin with #ExternalSource and end with #End ExternalSource.

Error ID: BC30578

To correct this error

  1. Add #ExternalSource to the appropriate location in your code.

  2. Remove #End ExternalSource if it is unnecessary.

See Also

Reference

#ExternalSource Directive

Other Resources

Conditional Compilation (Visual Basic)