Is there a way to enforce a class only to be used in ASP.NET ? So that it can't be referenced in a WinForm app or throw exception when instantiated. Is there some kind of .NET class attribute for this purpose?
Don't!!!
public class WebOnly
{
public WebOnly()
{
if (HttpContext.Current == null)
throw new Exception("me needs web");
}
}