2011-12-28 67 views
0

我創建了一個silverlight 5項目,並將一個文本框控件添加到一個xaml頁面,然後在文本框控件中添加了一個tract動作行爲。 還在main.xaml頁面上添加了ServiceOrientedAnalytics組件,並將該端點配置爲我的wcf服務。當我嘗試執行該項目時,我收到以下錯誤消息。在SL4中也是如此。我能夠跟蹤SL4中的事件,並且它的工作正常。任何人都可以幫助我解決這個問題。在SL5中使用Silverlight分析框架

我還從codeplex網站下載了最新的Microsoft Analytics源代碼,並將其添加到我的項目中,當我嘗試調試時,在導入日誌時發生同樣的異常。

錯誤消息:

at System.Windows.Navigation.PageResourceContentLoader.EndLoad(IAsyncResult asyncResult) 
    at System.Windows.Navigation.NavigationService.ContentLoader_BeginLoad_Callback(IAsyncResult result) 
Caused by: Add value to collection of type 'System.Windows.Interactivity.TriggerCollection' threw an exception. [Line: 22 Position: 27] 

    at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) 
    at SL5CompatibilityTest.Home.InitializeComponent() 
    at SL5CompatibilityTest.Home..ctor() 
Caused by: The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information. 

1) No valid exports were found that match the constraint '((exportDefinition.ContractName == "Log") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "System.Void(Microsoft.WebAnalytics.AnalyticsEvent)".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))', invalid exports may have been rejected. 

Resulting in: Cannot set import 'Microsoft.WebAnalytics.Behaviors.TrackAction.Log (ContractName="Log")' on part 'Microsoft.WebAnalytics.Behaviors.TrackAction'. 
Element: Microsoft.WebAnalytics.Behaviors.TrackAction.Log (ContractName="Log") --> Microsoft.WebAnalytics.Behaviors.TrackAction 


    at System.ComponentModel.Composition.CompositionResult.ThrowOnErrors(AtomicComposition atomicComposition) 
    at System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.Compose(CompositionBatch batch) 
    at System.ComponentModel.Composition.Hosting.CompositionContainer.Compose(CompositionBatch batch) 
    at System.ComponentModel.Composition.CompositionInitializer.SatisfyImports(ComposablePart part) 
    at System.ComponentModel.Composition.CompositionInitializer.SatisfyImports(Object attributedPart) 
    at Microsoft.WebAnalytics.Behaviors.TrackAction.OnAttached() 
    at System.Windows.Interactivity.TriggerAction.Attach(DependencyObject dependencyObject) 
    at System.Windows.Interactivity.TriggerActionCollection.OnAttached() 
    at System.Windows.Interactivity.AttachableCollection`1.Attach(DependencyObject dependencyObject) 
    at System.Windows.Interactivity.TriggerBase.Attach(DependencyObject dependencyObject) 
    at System.Windows.Interactivity.TriggerCollection.ItemAdded(TriggerBase item) 
    at System.Windows.Interactivity.AttachableCollection`1.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) 
    at System.Windows.DependencyObjectCollection`1.TryCollectionChanged(NotifyCollectionChangedEventArgs e) 
    at System.Windows.DependencyObjectCollection`1.System.Collections.IList.Add(Object value) 
    at MS.Internal.XamlManagedRuntimeRPInvokes.Add(XamlQualifiedObject& qoCollection, XamlPropertyToken inCollectionProperty, XamlQualifiedObject& inValue) 
+0

有一個針對Silverlight 5的MSAF構建(至少在源代碼樹中)。您是使用該版本還是SL4版本? – 2011-12-29 17:26:42

回答

0

我已經確定與MEF和Silverlight 5的問題,我正在努力解決這個問題。 DataCollector.Log方法未被MEF找到。

Michael S. Scherotter(MSAF的創始人)。

相關問題