I have a code library that works in ASP.NET, SQL CLR, and standalone applications and provides various functions based on whether certain namespaces are available (e.g. System.Drawing ) or not. Right now, I am excluding these code snippets manually, but it would be useful to have a C # compiler with it:
- I could be lazy
- I could use the same library.
I know that I can use the #if directives to search for definitions, and I could manually define something like ASP_NET , but if the way to do this is automatic, it will be even more.
So, can I detect ASP.NET? Alternatively, is it possible to determine if certain referenced assemblies are available?
source share