Skip to content

Fix an bug in the Design Time Build#9711

Merged
jonathanpeppers merged 1 commit intomainfrom
dev/dellis1972/fixstreamreadererror
Jan 27, 2025
Merged

Fix an bug in the Design Time Build#9711
jonathanpeppers merged 1 commit intomainfrom
dev/dellis1972/fixstreamreadererror

Conversation

@dellis1972
Copy link
Copy Markdown
Contributor

We got a bug report that a DTB in VS results in the following error.

System.ArgumentOutOfRangeException: Positive number required.
Parameter name: bufferSize
   at System.IO.StreamReader..ctor(Stream stream, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean leaveOpen)
   at Xamarin.Android.Tasks.GenerateResourceCaseMap.RunTask() in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/GenerateResourceCaseMap.cs:line 94
   at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25

We were passing -1 as the bufferSize. While this is fine under .net 9/10. It seems the full .net framework does not like it.

So lets fix it.

We got a bug report that a DTB in VS results in the following error.

```
System.ArgumentOutOfRangeException: Positive number required.
Parameter name: bufferSize
   at System.IO.StreamReader..ctor(Stream stream, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean leaveOpen)
   at Xamarin.Android.Tasks.GenerateResourceCaseMap.RunTask() in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/GenerateResourceCaseMap.cs:line 94
   at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25
```

We were passing `-1` as the bufferSize. While this is fine under .net 9/10.
It seems the full .net framework does not like it.

So lets fix it.
@jonathanpeppers jonathanpeppers merged commit 39cd9f7 into main Jan 27, 2025
@jonathanpeppers jonathanpeppers deleted the dev/dellis1972/fixstreamreadererror branch January 27, 2025 23:46
grendello added a commit that referenced this pull request Jan 28, 2025
* main:
  [ci] Remove test environment `$PATH` additions (#9712)
  [Xamarin.Android.Build.Tasks] Fix bug in the Design Time Build (#9711)
  [ci] Set `$(TreatWarningsAsErrors)` = `true` for CI builds. (#9689)
  [XABT] Fix ApplicationAttribute.ManageSpaceActivity manual mapping (#9708)
@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants