Add tests for disabling JsonSerializer.IsReflectionEnabledByDefault on PublishTrimmed=true#33757
Conversation
|
The current feature switches that get set when Thoughts on putting this one there instead to keep them all in one place? I think the reason they are in dotnet/runtime is because they version with the runtime version. So if you target net7.0, you get a different set than if you target net8.0. |
|
Does Microsoft.NET.ILLink.targets get included when you run build targets? |
|
Yes - the import is here: |
|
One more question -- can we set up testing in runtime or should I just make the change there and merge this PR once the sdk repo has absorbed the changes? |
|
Given dotnet/runtime#88480 was merged I've updated this PR to only include the tests. Will merge once an up-to-date built is absorbed and tests are passing. |
PublishTrimmed=truePublishTrimmed=true
|
Can you remove this line as part of this change? |
|
I could -- just to confirm, is it guaranteed |
Currently, yes I believe this is true. @MichalStrehovsky and @agocke can confirm. If we ever change that, we would change all the feature switches we default when PublishTrimmed=true to also check for PublishAot. |
Currently it probably is... but please don't rely on it. We're discussing setting |
|
@vitek-karas this suggests to me that we should update Microsoft.NET.ILLink.targets in runtime to also condition the feature switch on |
3b9543b to
d2c1d1f
Compare
|
I think the answer is "yes it should be", but the question is where. Currently the |
|
I'm fine with defaulting |
Fix dotnet/runtime#84378
cc @eerhardt @rolfbjarne @jonathanpeppers