private FileInfo CompileLicx(Configuration solutionConfiguration) { // create instance of License task LicenseTask lt = new LicenseTask(); // inherit project from solution task lt.Project = _solutionTask.Project; // inherit namespace manager from solution task lt.NamespaceManager = _solutionTask.NamespaceManager; // parent is solution task lt.Parent = _solutionTask; // inherit verbose setting from solution task lt.Verbose = _solutionTask.Verbose; // make sure framework specific information is set lt.InitializeTaskConfiguration(); // set parent of child elements lt.Assemblies.Parent = lt; // inherit project from solution task from parent task lt.Assemblies.Project = lt.Project; // inherit namespace manager from parent task lt.Assemblies.NamespaceManager = lt.NamespaceManager; // set base directory for filesets lt.Assemblies.BaseDirectory = new DirectoryInfo(Path.GetDirectoryName(Project.ProjectPath)); // set task properties lt.InputFile = InputFile; lt.OutputFile = GetCompiledResourceFile(solutionConfiguration); // convert target to uppercase to match VS.NET lt.Target = Path.GetFileName(Project.ProjectSettings.OutputFileName). ToUpper(CultureInfo.InvariantCulture); // inherit assembly references from project foreach (ReferenceBase reference in Project.References) { StringCollection assemblyReferences = reference.GetAssemblyReferences( solutionConfiguration); foreach (string assemblyFile in assemblyReferences) { lt.Assemblies.Includes.Add(assemblyFile); } } // increment indentation level lt.Project.Indent(); try { // execute task lt.Execute(); } finally { // restore indentation level lt.Project.Unindent(); } return lt.OutputFile; }