2017-08-09 66 views
0

我来自的NuGet安装了Xamarin窗体旋转视图旋转视图Xamarin形式给予2个错误

但是我得到2个错误:

1)无法解析组件:“Xamarin.Forms.CarouselView,版本= 0.0.0.0,Culture = neutral,PublicKeyToken = null'

2)“ResolveLibraryProjectImports”任务意外失败。 System.IO.FileNotFoundException:无法加载程序集'MashamApp,Version = 0.0.0.0,Culture = neutral,PublicKeyToken ='。也许它不适用于Android个人资料的Mono中?

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
     xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"    
     xmlns:control="clr-namespace:Xamarin.Forms;assembly=Xamarin.Forms.CarouselView" 
     x:Class="MashamApp.MainPage" BackgroundColor="#ff1b74bb"> 

<Grid x:Name="gMain" BackgroundColor="#ffebf6ff"> 

    <Grid.RowDefinitions> 
     <RowDefinition Height="1*"></RowDefinition> 
     <RowDefinition Height="1*"></RowDefinition> 
     <RowDefinition Height="1*"></RowDefinition> 
     <RowDefinition Height="1*"></RowDefinition> 
    </Grid.RowDefinitions> 

    <Grid Grid.Row="0"> 
     <Label x:Name="lblName" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" FontSize="Medium" TextColor="White"></Label> 
    </Grid> 

    <Grid Grid.Row="1"> 
     <control:CarouselView ItemsSource="{Binding MyDataSource}"> 
      <control:CarouselView.ItemTemplate> 
       <DataTemplate> 
        <Label Text="{Binding LabelText}" /> 
       </DataTemplate> 
      </control:CarouselView.ItemTemplate> 
     </control:CarouselView> 
    </Grid> 
+0

你所有项目中安装NuGet包,即在共享项目和Android项目? –

回答

0

我不能推荐任何代码更改,因为你看起来不错,但是Xamarin.Forms.CarouselView,版本= 0.0.0.0,文化=中立,公钥=空看起来有点可疑我。我建议是确保你拥有所有 您引用正常工作(通过该项目的基准没有黄色三角形)也许尝试重新安装所有程序包与NU GET包管理器控制台命令

Update-Package 

你也可以将其限制在一个项目中。

Update-Package -Project YourProjectName 

如果你想为以前安装的,那么你可以使用与更新-Package命令的-reinstall参数重新安装包的版本相同。

Update-Package -reinstall 

我从这个答案中拿了一些How do I get NuGet to install/update all the packages in the packages.config?

希望这会有所帮助!如果不让我知道,我会删除答案(我不得不使用答案,因为我不能评论50代表)干杯!

+0

好吧,看起来这不是他们改变课程名称的答案inisde the controll –

0

好,appearnly他们改变了命名空间的名称和控制研究的名称代码shuold可以是这样的:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
     xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"    
     xmlns:c="clr-namespace:CarouselView.FormsPlugin.Abstractions;assembly=CarouselView.FormsPlugin.Abstractions" 
     x:Class="MashamApp.MainPage" BackgroundColor="#ff1b74bb"> 

<Grid x:Name="gMain" BackgroundColor="#ffebf6ff"> 

    <Grid.RowDefinitions> 
     <RowDefinition Height="1*"></RowDefinition> 
     <RowDefinition Height="1*"></RowDefinition> 
     <RowDefinition Height="1*"></RowDefinition> 
     <RowDefinition Height="1*"></RowDefinition> 
    </Grid.RowDefinitions> 

    <Grid Grid.Row="0"> 
     <Label x:Name="lblName" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" FontSize="Medium" TextColor="White"></Label> 
    </Grid> 

    <Grid Grid.Row="1"> 
     <c:CarouselViewControl x:Name="CaruselViewCon" ItemsSource="{Binding MyDataSource}"> 
      <c:CarouselViewControl.ItemTemplate> 
       <DataTemplate> 
        <Image Source="{Binding LabelText}" TextColor="Black" /> 
       </DataTemplate> 
      </c:CarouselViewControl.ItemTemplate> 
     </c:CarouselViewControl> 
    </Grid>