Xamarin Studio 无法识别字符串插值

Xamarin Studio does not recognize String Interpolation

Xamarin Studio 5.10.3 版本 51

例如,如果我写了这段代码:

var text = $"Some string with {order}";
text = text.ToLower();

Xamarin studio 似乎无法确定 "text" 的数据类型。

"order" 也是一个对象,我无法访问它的属性。 我更改了项目的 C# 版本,但没有解决任何问题。

如果你知道这个问题的解决方法请告诉我。

根据 Xamarin 论坛,字符串插值在 Xamarin 6.0 中有效,检查下面的 link: https://forums.xamarin.com/discussion/55995/xamarin-studio-not-recognize-string-interpolation

您需要确保您 运行 使用 Xamarin Studio 6.0+。您目前可以在更新程序的 Alpha 频道上找到它。我相信其他版本对 C# 6 有部分支持。

https://developer.xamarin.com/releases/studio/xamarin.studio_6.0/xamarin.studio_6.0/#Roslyn_integration

https://developer.xamarin.com/recipes/cross-platform/ide/change_updates_channel/