public bool Execute()
        {
            var taskErrorState = false;

            try
            {
                var ws = MSBuildWorkspace.Create();
                var project = Task.Run(() => ws.OpenProjectAsync(BuildEngine.ProjectFileOfTaskNode)).Result;
                Compilation compilation;

                try
                {
                    compilation = Task.Run(() => project.GetCompilationAsync()).Result;
                }
                catch (Exception ex)
                {
                    BuildEngine.LogError($"Compilation process initiated by {nameof(DynamicFileGeneratorTask)} failed.");
                    BuildEngine.LogError(ex.Message);
                    return taskErrorState;
                }

                Assembly assembly = null;
                if (!GenerateIntermediateAssembly(compilation, ref assembly))
                    return taskErrorState;

                if (assembly != null)
                {
                    var codeFileManager = new CodeFileManager(BuildEngine.ProjectFileOfTaskNode);
                    var userGeneratorTypes = assembly.ExportedTypes.Where(d => typeof (ICodeFileGenerator).IsAssignableFrom(d));
                    var generators = CreateGenerators(userGeneratorTypes);
                    ExecuteGenerators(generators, assembly, codeFileManager);

                    CompilationPaths = string.Join(",", codeFileManager.CompilationPaths);
                    ContentPaths = string.Join(",", codeFileManager.ContentPaths);
                }
            }
            catch (Exception ex)
            {
                BuildEngine.LogError($"An exception occured within {nameof(DynamicFileGeneratorTask)}.");
                BuildEngine.LogError(ex.Message);

                return taskErrorState;
            }

            return true;
        }
 private static void ExecuteGenerators(List<ICodeFileGenerator> generators, Assembly assembly, CodeFileManager codeFileManager)
 {
     foreach (var generator in generators.OrderByDescending(d => d.GetPriority()))
     {
         generator.Process(assembly, codeFileManager);
     }
 }