2014-08-30 100 views
0

我的windows phone 7.5。應用程序正常工作,但升級到Windows Phone 8 o.s.後。我的視覺工作室不能運行我的應用程序,並顯示它在mainpage.xaml文件中的錯誤,像1行 我沒有實現任何richtext框我已經實現coading4fun工具包。無法投射System.Reflection.CustomAttributeData類型的對象visual studio 2012 windows phone 8

「無法投型 'System.Reflection.CustomAttributeData' 的對象鍵入 'System.ComponentModel.TypeConverterAttribute'

我的Visual Studio 2012 Express,用於Windows Phone的8更新4 我該怎麼解決。請幫我在此先感謝。

回答

0

我面臨同樣的問題,當我複製一個已定義<Image>標籤貼在同一頁上。

所以,以前<Image>標籤是

<Image x:Name="imgWallpaperThumbnail" Height="233" Stretch="UniformToFill" Margin="0,10,0,0" Tap="imgWallpaperThumbnail_Tap"> 
          <Image.Source> 
           <BitmapImage UriSource="{Binding ImagePath}" CreateOptions="BackgroundCreation" ></BitmapImage> 
          </Image.Source> 
         </Image> 

,當我複製並粘貼在同一頁上,然後它被轉換爲:

<Image x:Name="imgWallpaperThumbnail_Copy" Height="65" Margin="10,10,395,0" Tap="imgWallpaperThumbnail_Tap"> 
          <Image.Source> 
           <ImageSource>/Assets/Ellipse.png</ImageSource> 
          </Image.Source> 
         </Image> 

現在,查看圖片來源,它應該是<BitmapImage>而不是<Image.Source>

我建議你下載Visual Studio Community 2015,Update 3,它提供了詳細的例外。

<Image>是一個系統控制和源是它的屬性之一,它設置圖像。但是,當你應用圖像操作時,你應該使用來自System.Windows.Media.Imaging的BitmapImage,它提供了對象源類型,而不是成員System.Windows.Media的控制檯<Image>

相關問題