![](/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.