Giter Site home page Giter Site logo

Comments (12)

f-alizada avatar f-alizada commented on June 4, 2024 1

If there is a possibility of low usage, shall we put the change behind the changewave?

from msbuild.

rainersigwald avatar rainersigwald commented on June 4, 2024

Nice find! I can't believe that match is not case sensitive in the first place.

from msbuild.

KalleOlaviNiemitalo avatar KalleOlaviNiemitalo commented on June 4, 2024

Will the fix be considered a breaking change again?

from msbuild.

rainersigwald avatar rainersigwald commented on June 4, 2024

I'm inclined to say no--because "we already updated the documentation to say you can't do that" but it's definitely a concern. @baronfel do you have thoughts?

from msbuild.

KalleOlaviNiemitalo avatar KalleOlaviNiemitalo commented on June 4, 2024

Another possible fix would be to block access to System.Type references in general, rather than just GetType().

from msbuild.

baronfel avatar baronfel commented on June 4, 2024

I'm inclined to say 'no' for the same reason - the justification for the breaking change notes that there is no broadly-known usage of GetType any longer, so I think the impact of this would be quite low. If we get any significant user feedback that it is in use we can of course add breaking change notices quite quickly and out-of-band of the MSBuild code itself.

from msbuild.

f-alizada avatar f-alizada commented on June 4, 2024

I see :) We have the MSBUILDENABLEALLPROPERTYFUNCTIONS, so the need of changewave is lowered.
Had spent some time understanding why it is not reproducible in debug mode :

if (param != null && param.ToString() == param.GetType().FullName)

from msbuild.

KalleOlaviNiemitalo avatar KalleOlaviNiemitalo commented on June 4, 2024

Does that InvalidOperationException also trigger for param == "System.String"? If so, that seems misguided.

"System.String".ToString() == "System.String".GetType().FullName

from msbuild.

f-alizada avatar f-alizada commented on June 4, 2024

@KalleOlaviNiemitalo it was exactly the case.

from msbuild.

KalleOlaviNiemitalo avatar KalleOlaviNiemitalo commented on June 4, 2024

Oh, I assumed you had param == typeof(RuntimeType), thus typeof(RuntimeType).ToString() == typeof(RuntimeType).GetType().FullName.

from msbuild.

KalleOlaviNiemitalo avatar KalleOlaviNiemitalo commented on June 4, 2024

I imagine && !(param is string) would get rid of the false "Invalid type for message formatting argument" error.

from msbuild.

f-alizada avatar f-alizada commented on June 4, 2024

To be honest, I was thinking to leave it as it is, since it is in debug mode + the fix is prepared.
I'm not 100% sure that this fix should be applicble only for string, however did not investigate details, there could be cases when ToString method overriden and returns the value == param.GetType().FullName, since the arguments is an array of object object[] args.

from msbuild.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.