This repository has been archived by the owner on May 1, 2024. It is now read-only.
When using XAML compilation, StackOverflowException is raised in XamlCTask if the conditions are just right #2550
Labels
a/Xaml </>
e/5 🕔
5
help wanted
We welcome community contributions to any issue, but these might be a good place to start!
i/high
Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often
t/bug 🐛
up-for-grabs
We welcome community contributions to any issue, but these might be a good place to start!
Description
In a particular certain set of circumstances, the XamlCTask will error in a stack overflow in which the mono cecil library ping pongs between mscorlib and netstandard looking for System.Type.
The steps are pretty convoluted, my attached file is setup the way it needs to be.
The environment needed for the exception to occur is:
With this setup, when XamlCTask executes it:
For this to not have happened, netstandard.dll should have been loaded from the netstandard.library nuget package. I believe this can be done by preferring to load the requested dlls in the ReferencePath property first, and if it doesn't find it there, look in the search directories in the XamlCAssemblyResolver class.
Steps to Reproduce
MSBuild.exe "<Path to XamarinStaticBinding.sln>" /p:OutputPath="<Path to solution folder>\Output" /restore /p:Configuration="Release" /p:Platform="Any CPU" /verbosity:minimal
Expected Behavior
Compile succeeds
Actual Behavior
MSBuild crashes with a StackOverflowException
Basic Information
Reproduction Link
XamarinStaticBinding.zip
The text was updated successfully, but these errors were encountered: