-
Notifications
You must be signed in to change notification settings - Fork 747
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
VS 17.3.0 Preview 3.0 Generation failed: System.MissingMethodException: Method not found: 'System.ReadOnlySpan`1<Char> When LangVersion 8.0 or lower #9297
Comments
What a great catch. Thank you, the team will investigate asap now that we have a repro! |
So, team found the issue: The new msbuild shipped with 17.3 Preview 3 includes this commit where they bumped the System.Memory version: dotnet/msbuild@bfd80ab Our Source Gen Host therefore suddendly become incompatible because of that breaking change. If you do an bindingRedirect ,in this file it should start working again : "C:\Users\User.nuget\packages\uno.sourcegenerationtasks\4.0.2\build\host\net472\Uno.SourceGeneration.Host.exe.config" Short term, we'll push an update to our Source Generation Host. |
Thanks, it did the trick! The file is in Here's the text to easily paste it:
Save and restart Visual Studio |
Thank you for the more accurate details! |
The new Uno Source Generation host now tonains the updated dependency to System.Memory so the nuget should be updated to latest dev: https://www.nuget.org/packages/Uno.SourceGenerationTasks/4.1.0-dev.9
|
So, when my app uses Uno 4.2.6, workaround presented here ("set LangVersion to 9") works. But for newer Uno versions this workaround doesn't work, and app doesn't compile. |
Reference the latest Uno.SourceGenerationTasks as a workaround for unoplatform/uno#9297
* Adding new controls * Uno fixes * Added SettingsExpanderSample * Adding sampleref * Bugfixes * CI fix * Fix CI * Adding ExpanderV2 * CI fix * Update Generic.xaml * Add overrides * Uno fixes * CI fix * Update ExampleSettingsControlsTestClass.cs * Simplifing state setting * Revert "Simplifing state setting" This reverts commit a014377. * Quick fix to enable building locally to workaround unoplatform/uno#9297 * Update labs/SettingsControls/samples/SettingsControls.Samples/SettingsExpanderSample.xaml Co-authored-by: Michael Hawker MSFT (XAML Llama) <[email protected]> * Update labs/SettingsControls/samples/SettingsControls.Samples/SettingsExpanderSample.xaml Co-authored-by: Michael Hawker MSFT (XAML Llama) <[email protected]> * Tweaks * Renamed ButtonIcon to ActionIcon * Make SettingsExpander Content a ContentProperty * File rename * Making the StyleSelector work * Add github.com/rudyhuyn/XamlPlus Attached Style Helper Resolve issue with ToggleSwitch override due to microsoft/microsoft-ui-xaml#7792 * Add binding to Expander option toggle Note: should be TwoWay bound but issue on Uno, added note here for now: #207 (comment) * Removing HeaderedContentControl from the template * XAML styling * Removed HeaderedContentControl out of the SettingsCard template * Adding WrapThreshold * Fix failing test in SettingsCard tests * Tweaked SettingsCard sample * XAML styling * Remove SettingsExpanderItem and use SettingsCard directly Allows for better interop to just cut/paste SettingsCards in/out of Expanders 🙂 * UI tweaks to samples and SettingsCard to render the correct height * Adding VSM only * Temp: Comment out column trigger which was causing control to grow after state change and cause infinite layout cycle i.e. when the break point was reached (e.g. control size 560), VSM was changing the layout and now control size would be larger again (e.g. 605), which would then turn off trigger and re-layout back to old size which would now be smaller again, etc... We need to ensure the transition between the Right and Vertical states doesn't increase the width of the control. * Remove redundant minwidth * Clean up code, comments * Code cleanup SettingsCard * Settings ToolkitSampleRenderer alignment to Stretch * Bumping version number * Removing HeaderedContentControl * Removing remaining reference * Add triggers * Update Generic.xaml * Update Generic.xaml * Use ThemeResource instead of StaticResource Co-authored-by: michael-hawker <[email protected]> Co-authored-by: Rudy Huyn <[email protected]>
* Adding new controls * Uno fixes * Added SettingsExpanderSample * Adding sampleref * Bugfixes * CI fix * Fix CI * Adding ExpanderV2 * CI fix * Update Generic.xaml * Add overrides * Uno fixes * CI fix * Update ExampleSettingsControlsTestClass.cs * Simplifing state setting * Revert "Simplifing state setting" This reverts commit a014377730da0672d6e8010e58de0d006b0099ba. * Quick fix to enable building locally to workaround unoplatform/uno#9297 * Update labs/SettingsControls/samples/SettingsControls.Samples/SettingsExpanderSample.xaml Co-authored-by: Michael Hawker MSFT (XAML Llama) <[email protected]> * Update labs/SettingsControls/samples/SettingsControls.Samples/SettingsExpanderSample.xaml Co-authored-by: Michael Hawker MSFT (XAML Llama) <[email protected]> * Tweaks * Renamed ButtonIcon to ActionIcon * Make SettingsExpander Content a ContentProperty * File rename * Making the StyleSelector work * Add github.com/rudyhuyn/XamlPlus Attached Style Helper Resolve issue with ToggleSwitch override due to microsoft/microsoft-ui-xaml#7792 * Add binding to Expander option toggle Note: should be TwoWay bound but issue on Uno, added note here for now: CommunityToolkit/Labs-Windows#207 (comment) * Removing HeaderedContentControl from the template * XAML styling * Removed HeaderedContentControl out of the SettingsCard template * Adding WrapThreshold * Fix failing test in SettingsCard tests * Tweaked SettingsCard sample * XAML styling * Remove SettingsExpanderItem and use SettingsCard directly Allows for better interop to just cut/paste SettingsCards in/out of Expanders 🙂 * UI tweaks to samples and SettingsCard to render the correct height * Adding VSM only * Temp: Comment out column trigger which was causing control to grow after state change and cause infinite layout cycle i.e. when the break point was reached (e.g. control size 560), VSM was changing the layout and now control size would be larger again (e.g. 605), which would then turn off trigger and re-layout back to old size which would now be smaller again, etc... We need to ensure the transition between the Right and Vertical states doesn't increase the width of the control. * Remove redundant minwidth * Clean up code, comments * Code cleanup SettingsCard * Settings ToolkitSampleRenderer alignment to Stretch * Bumping version number * Removing HeaderedContentControl * Removing remaining reference * Add triggers * Update Generic.xaml * Update Generic.xaml * Use ThemeResource instead of StaticResource Co-authored-by: michael-hawker <[email protected]> Co-authored-by: Rudy Huyn <[email protected]>
Current behavior
Testing Uno.Samples on VS2022 preview 3 gives error when building projects with LangVersion 8.0 included in the .csproj file.
Expected behavior
The samples build successfully. If the LangVersion 8 is not supported, a better message when building to make troubleshooting easier.
How to reproduce it (as minimally and precisely as possible)
Add 8.0 to a .csproj file, these are included in some of the samples, I tested ChatSignalR and SkiaSharpTest, also fails when adding to a sample which doesn't include LangVersion.
Workaround
Update .csproj to use LangVersion 9 or higher
Works on UWP/WinUI
Yes
Environment
No response
NuGet package version(s)
from ChatSignalR sample
Affected platforms
Build tasks
IDE
Visual Studio 2022
IDE version
17.3.0 Preview 3.0
Relevant plugins
No response
Anything else we need to know?
No response
The text was updated successfully, but these errors were encountered: