lundi 4 février 2019

Is there a way to find the path to class file present in some other project ( not the startup project) using c#?

I know the class name. Now i want to know the path of this class present in the current working solution. Eg: I have a solution in visual studio which contains 5 projects- A, B, C, D, E. C is my startup project. I know the class "abc.cs" which can be present in any of these 5 projects. Is there a way to find the path to this class file using c#?

I have tried this:

var fileName= @"abc.cs";

FileInfo f = new FileInfo(filename);

This throws exception that file does not exist, as it looks into current working directory.





Aucun commentaire:

Enregistrer un commentaire