New Posts New Posts RSS Feed: Cocktail Lesson 4
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Cocktail Lesson 4

 Post Reply Post Reply
Author
madcatrobert View Drop Down
Newbie
Newbie
Avatar

Joined: 21-Feb-2012
Posts: 3
Post Options Post Options   Quote madcatrobert Quote  Post ReplyReply Direct Link To This Post Topic: Cocktail Lesson 4
    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()     

 

HappyHourTestPage.html, line 54 character 13

The line of xaml code in MainPage.xaml is: <ResourceDictionary Source="HappyHour;component/Views/DrinkOrderDataTemplate.xaml" >
 
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

Back to Top
WardBell View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Mar-2009
Location: Emeryville, CA,
Posts: 338
Post Options Post Options   Quote WardBell Quote  Post ReplyReply Direct Link To This Post 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).
 
 
Back to Top
madcatrobert View Drop Down
Newbie
Newbie
Avatar

Joined: 21-Feb-2012
Posts: 3
Post Options Post Options   Quote madcatrobert Quote  Post ReplyReply Direct Link To This Post Posted: 21-Feb-2012 at 12:56pm
uploads/1401/HappyHour.zipHi 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
Back to Top
madcatrobert View Drop Down
Newbie
Newbie
Avatar

Joined: 21-Feb-2012
Posts: 3
Post Options Post Options   Quote madcatrobert Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down