Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking for int.MinValue separately. #471

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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:

xamarin/xamarin-macios#12508

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.

None yet

2 participants