Skip to content

Instantly share code, notes, and snippets.

@MikeCodesDotNET
Created May 11, 2020 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikeCodesDotNET/a64a7818298f0863732e379476fd3322 to your computer and use it in GitHub Desktop.
Save MikeCodesDotNET/a64a7818298f0863732e379476fd3322 to your computer and use it in GitHub Desktop.
foreach(UsingDirectiveSyntax usingDirective in syntaxRootNode.Usings)
{
ISymbol symbol = semanticModel.GetSymbolInfo(usingDirective.Name).Symbol;
string name = symbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat);
if(name == "System.IO")
throw new Exception("whoa!!, you can't be using that here!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment