Block Execution of GetType() in Evaluation - #6769
Conversation
There was a problem hiding this comment.
This is needed because the type of the object in my test was System.String and in #DEBUG it thought it was an invalid ToString() call on a resource. That ended up throwing another invalid project exception which caused a stack overflow.
|
🤣 |
Stop allowing execution of GetType. This can lead to a lot of methods available that should not be called during evaluation.
10dc49c to
be92f49
Compare
@jeffkl Thought you might appreciate this 😄 |
rainersigwald
left a comment
There was a problem hiding this comment.
This looks good and I am in favor of the change. My only concern is that it's coming a bit late in the cycle for a breaking change. IIRC we discussed this and agreed on taking it now, is that right @marcpopMSFT?
|
I think we decided to take it as long as it made it in for preview 4 to give time for feedback given it was not particularly safe to do this. I don't think there's a good way of finding out if people are calling this already and how often. |
|
Can ya'll take a quick look through these queries to see if any critical areas are impacted (eg CBT): Looks like a handful of impacted customers but not many. |
|
Those links look fine. I did a spot check of |
| // Check that the function that we're going to call is valid to call | ||
| if (!IsInstanceMethodAvailable(_methodMethodName)) | ||
| { | ||
| ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "InvalidFunctionMethodUnavailable", _methodMethodName, _receiverType.FullName); |
There was a problem hiding this comment.
Should we modify the message to mention that there's a way to enable all methods with Traits.Instance.EnableAllPropertyFunctions? It would be less painful for customers this way.
|
Breaking change documentation for this is here: https://docs.microsoft.com/dotnet/core/compatibility/sdk/6.0/calling-gettype-property-functions |
Stop allowing execution of
GetType(). This can lead to calling methods that really should not be called during evaluation.