2009-04-18 2 views
12

Trong App.xaml Tôi có đoạn mã sau:"người thừa kế của ResourceDictionary dự kiến" - không lỗi này có ý nghĩa gì

<Application 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    x:Class="FJW.App"> 
    <Application.Resources> 
     <!-- Resources scoped at the Application level should be defined here. --> 
     <ResourceDictionary> 
      <ResourceDictionary.MergedDictionaries> 
       <ResourceDictionary Source="themes/F4.xaml"/> 
       <ResourceDictionary Source="themes/F3.xaml"/> 
       <ResourceDictionary Source="themes/F2.xaml"/> 
       <ResourceDictionary Source="themes/F0.xaml"/> 
       <ResourceDictionary Source="themes/F1.xaml"/> 
       <ResourceDictionary Source="themes/Palm.xaml"/> 
       <ResourceDictionary Source="themes/Key.xaml"/> 
      </ResourceDictionary.MergedDictionaries> 
     </ResourceDictionary> 
    </Application.Resources> 
</Application> 

Visual Studio là tìm lỗi trong chuỗi <ResourceDictionary Source="themes/...xaml"/> - nâng cao thông báo lỗi sau: Người thừa kế ResourceDictionary được mong đợi.

Nhưng dự án đang được biên dịch đúng cách và đang hoạt động đúng. Thông báo lỗi có nghĩa là gì? Có thể đó là lỗi của phiên bản Silverlight beta này? Hay là lỗi của tôi?

Trả lời

27

Hm. Đó là một vấn đề BuildAction.

Tôi thiết lập thuộc tính BuildAction cho xamls làm Tài nguyên. Và khi tôi thay đổi thuộc tính này trở lại Page - erorrs bị biến mất.

+2

Cảm ơn bạn! Tôi đã từng gặp vấn đề tương tự. –

+1

Cái này hoạt động! – Bulat

+0

cảm ơn, nó hoạt động !! – viky

0

Có thể là nội dung nào đó bên trong một tệp .xaml đang nhận được bạn không? Tôi đã sao chép mã của bạn vào một dự án mới và không thấy bất kỳ thông báo lỗi nào trong Visual Studio hoặc Expression Blend.

alt text http://www.smips.com/brad/stackoverflow/so-109.jpg

+0

Tôi nghĩ là không thể. Trở thành khi tôi để lại chỉ một xaml trong thư mục chủ đề - không có lỗi. – FFire