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: http://rapidshare.com/files/436756052/SilverlightApplication2.zip

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): http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=d197f51a-de07-4edf-9cba-1f1b4a22110d
for WPF (version 4.0.3.x): http://www.microsoft.com/downloads/details.aspx?familyid=75E13D71-7C53-4382-9592-6C07C6A00207&displaylang=en
for WP7 (version 3.7.5): http://www.microsoft.com/downloads/details.aspx?FamilyID=86370108-4c14-42ee-8855-226e5dd9b85b&displaylang=en

- System.Observable.dll
for Silverlight from Rx-framework http://msdn.microsoft.com/en-us/devlabs/ee794896.aspx 
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,