StyleCop SDK : How to get the project name of source document
I am writing custom rules using StyleCop SDK. I need to get the name of visual studio project where the checked element resides. Is there any way to get this开发者_运维技巧?
element.Document.SourceCode.Project does not give the project name.
Thanks,
Madhu
I got the solution.
string projectLocation = element.Document.SourceCode.Project.Location;
string projectName = Path.GetFileNameWithoutExtension(projectLocation).Trim();
Thanks,
Madhu
精彩评论