使用Xamarin表单在Visual Studio中创建Hello World失败 [英] Creating a Hello World in Visual Studio with Xamarin Forms Fails
问题描述
我正在引用此解决方案/问题 The类型或名称空间名称'Xamarin'在Xamarin Studio中丢失
I'm referencing this solution/question The type or namespace name 'Xamarin' missing in xamarin studio
但是仍然无法通过新的通用应用程序项目向导来构建应用程序.
However its still not possible to build the app from a new universal app project wizard.
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人群有什么想法吗?
Any ideas from the new-to-Xamarin crowd?
推荐答案
好的,这就是答案!我对此进行了本地复制,似乎.csproj中缺少一些引用:
Okay here's the answer! I had a local reproduction of this and it seems that there are some references missing in the .csproj:
请确保将以下内容作为引用添加到您的 .csproj
中:
Please ensure the following is added to your .csproj
as References:
<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>
然后您可以从项目中删除 Resource.designer.cs
文件,重建项目,然后将 Resource.designer.cs
文件重新添加到您的项目中项目.它应生成以下 Attribute
项目: https://gist.github.com/JonDouglas/7adf61469ce21663d7f536a4aa27c7df
You can then remove the Resource.designer.cs
file from your project, rebuild your project, and then re-add the Resource.designer.cs
file to your project. It should generate the following Attribute
items: https://gist.github.com/JonDouglas/7adf61469ce21663d7f536a4aa27c7df
这篇关于使用Xamarin表单在Visual Studio中创建Hello World失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!