开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜