using ClassLibrary1; using System; using System.Linq; using System.Reflection; namespace ConsoleApp4 { class Program { static void Main(string[] args) { Assembly assembly = Assembly.GetCallingAssembly(); var typesWithMyAttribute = from t in assembly.GetTypes() let attributes = t.GetCustomAttributes(typeof(CosmosDBAttribute), false) where attributes != null && attributes.Length > 0 select new { Type = t, Attributes = attributes.Cast() }; Console.WriteLine("Hello World!"); } } }