Print Page | Close Window

Cocktail Lesson 4

Printed From: IdeaBlade
Category: Cocktail
Forum Name: Community Forum
Forum Discription: A professional application framework using Caliburn.Micro and DevForce
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3278
Printed Date: 06-Dec-2019 at 12:41pm


Topic: Cocktail Lesson 4
Posted By: madcatrobert
Subject: Cocktail Lesson 4
Date Posted: 21-Feb-2012 at 9:21am
When I ran the code after completion of Lesson 4, the following error was thrown:

SCRIPT5022: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.Windows.Markup.XamlParseException: Failed to assign to property 'System.Windows.ResourceDictionary.Source'. [Line: 12 Position: 44]
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at HappyHour.Views.MainPage.InitializeComponent()     

 

http://www.ideablade.com/forum/0 -

 
After checking my code against, it seems that everything is the same, so what is causing thei error? How do I find the fix?
 
Thanks




Replies:
Posted By: WardBell
Date Posted: 21-Feb-2012 at 12:16pm
Hi madcatrobert (may I call you MadCat?).
 
I just cleaned and rebuilt my copy of Lesson 4 (the Silverlight 4 version, right?) and it works fine on my machine. So my first question to you is "have you tried building and running the sample lesson 4 ... exactly as it was shipped?"
 
If fails in this manner on the shipped sample, then we need to follow a different path to resolution. For the balance of THIS reply, I'll suppose that you are following the Lesson 4 instructions by hand. Perhaps there is a glitch in the instructions; it would be great if you helped me find it so I can get those instructions back on track.
 
There are several ways to produce the exception you're reporting. I just did it on purpose to myself ... by changing the "Build Action" on my "/Views/DrinkOrderDataTemplate.xaml" from "Page" to "None". A misspelling of "DrinkOrderDataTemplate.xaml" would cause that exception as well.
 
These are logical places to start looking. If you still have this problem after making sure that you don't have a transcription error, or a Build Action problem ... or if it doesn't work when you use the shipped lesson code, get back to us right away.
 
It might be useful then to attach a zip of the code to your report (plrease exclude all binaries ... and please don't paste the source code into your report).
 
 


Posted By: madcatrobert
Date Posted: 21-Feb-2012 at 12:56pm
uploads/1401/HappyHour.zip - uploads/1401/HappyHour.zip Hi Ward,
 
Actually I am using Silverlight 5 and you may call me Robert. I checked the spelling and all is correct and Build Action is Page. So, I am uploading to you HappyHour.zip for your persusal. I have removed all bineries; i.e., .dll and .pdb as well as files created by the compiler.
 
Should you require anything else, please respond through the forum.
 
Thanks,
MCR


Posted By: madcatrobert
Date Posted: 23-Feb-2012 at 9:21am
Ward,
 
I found the problem. Line 12 of MainPage.xaml was this: <ResourceDictionary Source="HappyHour;component/Views/DrinkOrderDataTemplate.xaml" /> What was missing was the preceeding /Happy…
 
Eyes missed it but WinMerge found it.



Print Page | Close Window