![](/img/trans.png)
[英]Hundreds of Resource.Designer.cs build errors on latest Xamarin Forms 2.2.0.45
[英]OxyPlot.Xamarin.Forms package breaks Resource.Designer.cs?
我正在尝试在我的共享Xamarin.Forms项目中使用OxyPlot.Xamarin.Forms包。 我在便携式和平台特定(Android)项目中添加了带有NuGet包管理器的OxyPlot包,如下所述:
http://docs.oxyplot.org/en/latest/getting-started/hello-xamarin-forms.html
然后我在Android项目中初始化了OxyPlot渲染器。 现在,当我尝试启动App时,生成了Resource.Designer.cs文件,但是我得到了数百个错误:
Error CS0117 'Resource.Attribute' does not contain a definition for 'mediaRouteSettingsDrawable' OxyPlotShared.Droid \OxyPlotShared\OxyPlotShared.Droid\Resources\Resource.Designer.cs
我在版本1.0.0-unstable1983中使用Xamarin.Forms v2.2.0.31和所有OxyPlot包。
我错过了什么吗?
请注意,有2个不同的项目模板: Portable和Shared 。 在你的帖子中你提到了它们,所以要清楚你正在使用哪一个。 您所关注的具体示例适用于Portable项目模板。 添加OxyPlot Nuget Package之后 ,我不得不手动将OxyPlot和OxyPlot.Xamarin.Forms添加到Portable的References中。 在那之后,它工作得很好。 我正在使用Xamarin.Forms 2.0.0.6482和OxyPlot 1.0.0-unstable1983。
我使用代码添加了PlotView
:
App.cs:
public App()
{
PlotModel plotModel = new PlotModel { PlotAreaBackground = OxyColors.LightYellow };
plotModel.Series.Add(new FunctionSeries(Math.Sin, -10, 10, 0.1, "sin(x)"));
// The root page of your application
MainPage = new ContentPage {
Content = new PlotView {
VerticalOptions = LayoutOptions.Fill,
HorizontalOptions = LayoutOptions.Fill,
Model = plotModel
}
};
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.