1
ReturnType for methods
Question asked by Jerry Nothstine - 9/10/2026 at 1:50 PM
Answered
I am using GhostDoc Pro in VS 2026.  I want to set the ReturnType to just be the Name and not the FullName.  When I try ReturnType.Name I get validation error.  I can't find the correct property to just get the name.  Is there a prperty for that?

3 Replies

Reply to Thread
0
Misha Zhutov Replied
Employee Post Marked As Answer
Hi Jerry, 

Could you please provide us (to support@submain.com) with the template which got you an error. What kind of error did you experience?
0
Jerry Nothstine Replied
Here is the error message:

Line:    318
Column:    66
Code:    CS1061
Error:    Compiling transformation: CS1061: 'ReturnType' does not contain a definition for 'Name' and no accessible extension method 'Name' accepting a first argument of type 'ReturnType' could be found (are you missing a using directive or an assembly reference?)

Here is my rules content GhostDocRules.txt
0
Misha Zhutov Replied
Employee Post
Hi Jerry,  

The ReturnType object doesn't contain a Name field. It contains only FullName. In your code, you check Context.CurrentCodeElement.HasReturnType. If it is True, then you should not check for 
!string.IsNullOrEmpty(Context.CurrentCodeElement.ReturnType.FullName).
If you need the ReturnType name, then use ReturnType.FullName.Substring(ReturnType.FullName.LastIndexOf('.') + 1);

Reply to Thread