This project is read-only.

Exception when creating application

Dec 13, 2010 at 9:14 PM

I try to create an app with nRoute using both the template from the extension manager or by hand folowing the tutorial.

But when the application launches, I get an error in the MainPage.xaml.cs file during InitializeComponent();

Add value to collection of type 'System.Windows.Interactivity.BehaviorCollection' threw an exception. [Line: 12 Position: 36]

How can I solve it? Here is a sample solution I've made:

Dec 13, 2010 at 9:30 PM

1. If I would have used the wrong version then when you have downloaded and launched the app it would also fail :)

2. The same thing happens when I create an app from VS nRoute template so I asume that the templates use the correct dll ;)

Dec 13, 2010 at 9:50 PM

I'll just chip-in any say the most likely cause for your problem could be a. targeting the wrong framework (like SL with a WPF dll) or b., which is more likely, not having the right dependencies installed. The following are the required dependencies:

- System.Windows.Interactivity.dll
for Silverlight (version 4.0.5.x):
for WPF (version 4.0.3.x):
for WP7 (version 3.7.5):

- System.Observable.dll
for Silverlight from Rx-framework 
for WP7 (it is available in the tools, ensure it is referenced)

- System.Runtime.Serialization.dll
this is available in all .NET runtime versions, just ensure it is referenced

Hope this helps,