C# 在VisualStudio中使用Xamarin表单创建Hello World失败
我引用的是这个解决方案/问题 但是,仍然无法从新的通用应用程序项目向导构建应用程序C# 在VisualStudio中使用Xamarin表单创建Hello World失败,c#,xamarin,visual-studio-2015,C#,Xamarin,Visual Studio 2015,我引用的是这个解决方案/问题 但是,仍然无法从新的通用应用程序项目向导构建应用程序 Severity Code Description Project File Line Suppression State Error CS0117 'Resource.Attribute' does not contain a definition for 'actionBarSize' Project.Droid C:\dev\Project.Droid\Resource
Severity Code Description Project File Line Suppression State
Error CS0117 'Resource.Attribute' does not contain a definition for 'actionBarSize'
Project.Droid C:\dev\Project.Droid\Resources\Resource.Designer.cs 29 Active
新来的Xamarin人有什么想法吗?好的,答案就在这里!我在当地复制了这一版本,似乎在.csproj中缺少了一些参考资料: 请确保以下内容作为参考添加到您的
.csproj
:
<Reference Include="Xamarin.Android.Support.Design, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Android.Support.Design.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.Design.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Android.Support.v4.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Android.Support.v7.AppCompat, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Android.Support.v7.AppCompat.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.v7.AppCompat.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Android.Support.v7.CardView, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Android.Support.v7.CardView.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.v7.CardView.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Android.Support.v7.MediaRouter, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Android.Support.v7.MediaRouter.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.v7.MediaRouter.dll</HintPath>
<Private>True</Private>
</Reference>
..\..\packages\Xamarin.Android.Support.Design.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.Design.dll
真的
..\..\packages\Xamarin.Android.Support.v4.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll
真的
..\..\packages\Xamarin.Android.Support.v7.AppCompat.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.v7.AppCompat.dll
真的
..\..\packages\Xamarin.Android.Support.v7.CardView.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.v7.CardView.dll
真的
..\..\packages\Xamarin.Android.Support.v7.MediaRouter.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.v7.MediaRouter.dll
真的
然后,您可以从项目中删除
Resource.designer.cs
文件,重建项目,然后将Resource.designer.cs
文件重新添加到项目中。它应该生成以下属性
项:您使用的是什么版本的Xamarin.Forms?其次,引用了相应的Google支持库的哪个版本?2.1.0.6529当前是从我通过NuGet添加它时开始安装的。我不确定是否安装了google支持库。能否粘贴资源.desginer.cs
文件的内容?也许在要点中,我们会在找到一行代码之后,沿着以下行:public const int actionBarSize=2130772085
如果您的资源.designer.cs
文件中没有类似的元素,请尝试通过NuGet重新安装Xamarin.Forms并删除资源.designer.cs
文件。再次尝试编译,文件将被隐藏,请将其重新添加到您的解决方案中。我将查找上面提到的代码。删除资源.designer.cs
可以编译项目(.droid)。重新添加它会返回错误。我需要那个文件吗?如何在没有错误的情况下重新添加它?