WP7 has limits on what kind of References you can use
Apr
13
Written by:
Tuesday, April 13, 2010 8:36 PM
Trying to create your WP7 application and create proper "tiers," ya how's that work'n out for ya?
Today I was talking with SB, together with CM and LP, we're working on a demo/showcase WP7 application for Ottawa IT Day. We're focusing on Silverlight and WP7 and as such we wanted to "share" as much code as possible. GREAT! You might think, and so did we! Until I remembered a few nights ago trying to add references to other projects. If you're not careful, you could HOOP yourself. Watch what you get when you try to reference just any ol'DLL.

Notice that? From a WP7 project, you can only reference another WP7 project or a Silverlight 3 project. BUT, to be honest, that's still a bit too ambigious. You're able to target different versions of .NET, but don't confuse that with the version of Silveright you're using! Oh no!

What do I mean? Let's try it out. From the above dialog, select Silverlight Class Library (we want to end up with a DLL right?), then watch the next few dialogs.

So, what's the problem here? Well, nothing, well, EXCEPT our desired plan is to have a DLL we CAN USE IN WP7! From the first screen cap above, it seems like our choice is pretty clear on THIS dialog. Go ahead and pick the Silverlight 3 version from the drop down and your new project will be create. Cool.
Next, we can go ahead an add our reference to this new SL3 DLL project in our WP7 app.


Ok, so we're done right? Nope, noooooooot quite yet, almost, but not quite yet. There's one last chicken switch.

NOW you're Done!

What do you do though IF you've ALREADY created your Silverlight DLL with Silverlight Version 4? Don't worry too much, easy enough to change/tweak in the Project Properties.

HHHHMMMMM You might be asking, uh, Peter, IF you have the option to pick the version of Silverlight, uh, what's the difference? Good question. Watch and see what OTHER references you can access inside of the Silverlight DLL.
BEAUTIFUL! You're ready to start using objects in that referenced project! Now it's time to grab a coffee and get coding!
2 comment(s) so far...
Re: WP7 has limits on what kind of References you can use
Are you saying that you can reference Silverlight 3 assembly in Silverlight for Windows Phone 7? I don't think you can reference all kinda Silverlight 3 assemblies. Can you please try to reference Castle Dyanmic Proxy Silverlight version in WP7 and see whether it's working or not?
By Michael Sync on
Wednesday, April 14, 2010 1:17 AM
|
Re: WP7 has limits on what kind of References you can use
Hi Michael, thanks for the question, I guess you're up late too? Are you EST? I'm a bit under the gun right now working on a presentation for Sat, but I willl try this out on Sun. If you find out something too, please post. Thanks. Sorry to pass the buck, but I've been plugging away on this for a while now with a lot of late nights, it's a WP7 demo! Very cool IMHO! :>
By phenry on
Wednesday, April 14, 2010 1:18 AM
|