How can I remove exception “Predefined type 'ValueTuple`2' must be a struct” when debugging?

时光怂恿深爱的人放手 提交于 2019-12-30 09:58:24

问题


I started using the new tuple feature in c# 7.0 but I noticed that neither in the function that returns a tuple nor in its caller is possible to check the variable values in debug mode. Instead an exception is shown:

$exception  error CS8182: Predefined type 'ValueTuple`2' must be a struct.  

Is there a way to get rid of that glitch and debug normally?


回答1:


It seems a bug that Microsoft has fixed but it will be available in a future update (2017) https://github.com/dotnet/roslyn/pull/16930




回答2:


It is a bug in the current version of System.ValueTuple. To workaround it till MS releases the fix, downgrade the package version from 4.3.0 to a pre-release one.



来源:https://stackoverflow.com/questions/42856319/how-can-i-remove-exception-predefined-type-valuetuple2-must-be-a-struct-whe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!