Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
726 views
in Technique[技术] by (71.8m points)

c# - Creating a Hello World in Visual Studio with Xamarin Forms Fails

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:devProject.DroidResourcesResource.Designer.cs 29  Active

Any ideas from the new-to-Xamarin crowd?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Okay here's the answer! I had a local reproduction of this and it seems that there are some references missing in the .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>....packagesXamarin.Android.Support.Design.23.0.1.3libMonoAndroid403Xamarin.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>....packagesXamarin.Android.Support.v4.23.0.1.3libMonoAndroid403Xamarin.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>....packagesXamarin.Android.Support.v7.AppCompat.23.0.1.3libMonoAndroid403Xamarin.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>....packagesXamarin.Android.Support.v7.CardView.23.0.1.3libMonoAndroid403Xamarin.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>....packagesXamarin.Android.Support.v7.MediaRouter.23.0.1.3libMonoAndroid403Xamarin.Android.Support.v7.MediaRouter.dll</HintPath>
  <Private>True</Private>
</Reference>

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...