| Severity | Warning |
| Reported by | PostSharp |
| Message | The async stepping information of the method <Method> cannot be written to the PDB file, because the method has a different number of yield points and resume points. The PDB file will not contain this information for this method. |
Cause
The C# compiler writes async stepping information to the PDB file for the MoveNext method of the state machine of each async method: the offset of each point where the method yields at an await expression, and the offset of the matching point where it resumes. The debugger uses this information to step over await expressions.
When PostSharp rewrites the assembly, it writes a new PDB file with the offsets of the woven code. When the PDB file has the Windows format, used with the full or pdbonly value of the DebugType MSBuild property, PostSharp reports PS0231 if the number of yield points of <Method> differs from its number of resume points. PostSharp then writes the PDB file without the async stepping information of this method. The assembly and the rest of the debugging information are not affected. Portable PDB files, the default of SDK-style projects, do not go through this check.
The yield points and resume points come in pairs in the code that the compiler generates, so this message points to an inconsistency inside PostSharp, and no example can show it.
Resolution
- The warning does not affect the behavior of the program. When you do not need to step over the
awaitexpressions of<Method>in the debugger, you can ignore it. - Use portable PDB files: set the
DebugTypeMSBuild property toportablein the project file, for example<DebugType>portable</DebugType>. - Report the problem to the PostSharp support team, with the build log and, if possible, the async method named in the message and the aspects applied to it.
See Also
Other Resources