![]() So far, the expected output is to have a list of Nodes, each Node corresponds to a Visual Studio project found under the root folder. ProjectMetadata _m = _ĭependency = Path.GetFileNameWithoutExtension(_m.EvaluatedValue) _temp = new Node(p.GetPropertyValue( " ProjectName")) įoreach (ProjectItem _item in p.GetItems( " Reference")) ![]() Project p = _ProjCollection.LoadProject(_proj) Īssembly = p.GetPropertyValue( " TargetName") String projects = Directory.GetFiles(path, " *.csproj", SearchOption.AllDirectories) / /// Root folder private void LoadProjects( string path) csproj files found under the root folder and loads a graph between them NET Framework and its value has the path of such reference. This key word is used for libraries referenced outside the. In order to get the dependencies of a project (the libraries referenced by this project in order to build), I’ll be getting all the references containing the keyword “ HintPath”. If it doesn’t, we can safely assume that such project is a third party library which we don’t own, and thus we don’t have such source code but just the binary file. Each project will eventually be reached by the main for loop. Fortunately, there is no need for a recursive call or stack. Once all the projects have been retrieved, for each project, I’ll be creating a new instance of the class Node with the mentioned properties and initializing the dependency list with the libraries referenced by this project. csproj files) found under a given directory/folder. The idea here is to explore all the projects, in my case, the Visual Studio C# projects (. You can add and extend the properties of this class to fit your needs. / /// List of other projects that are needed to compile this / /// String with the compilation output / private string assemblyName, projectName / /// string for project and assembly names To keep it simple, the properties that will be tracked with this Node class are: In order to build the dependency graph, I’ll be treating each Visual Studio project as a node.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |