2017-08-09 62 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>