Skip to content

Conversation

@renefloor
Copy link

We use this library with Xamarin. When updating Visual Studio this library broke, but only when building for a release package. When debugging everything worked fine.

After adding extra logging we found that t1.GetField("MinValue") resulting in null and thus isMin1 was false. When setting an EndDate it complained that "Both COUNT and UNTIL cannot be supplied together; they are mutually exclusive."

As CheckMutuallyExclusive is only used once and count is always obj1 I just added a check for int.MinValue if obj1 is an int.

I cannot find why this behaviour changed. I also don't know whether it is the xamarin compiler, the .net framework or the c# language. (We forced c# to 7.0, so the last one shouldn't be the problem.)

For now this fixes our problem, but I can understand it when you don't really like the solution and I'm willing to discuss a better solution.

For some reason GetField("MinValue") can fail on integers.
@winstonpang
Copy link

We got this exact same problem as well in an app that's deployed, I've logged an issue on the xamarin repo as well:

dotnet/macios#12508

@minichma
Copy link
Collaborator

minichma commented Dec 7, 2024

This will be fixed soon by separate efforts making COUNT and UNTIL nullable rather than working with magic numbers (MinValue).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants