Search
Thursday, December 13, 2018 ..:: Home ::.. Register  Login
   Calendar  
     
  
   Search  
     
  
   Blogroll  
     
  
   Disclosure  
All blog entries are the opinions of the author and do not necessarily reflect the opinions of their employer. All the code presented is for explanation and demonstration purposes only. Any damages incurred to your site and/or data are not the responsibility of the author. Every effort is taken to ensure the code properly compiles, however sometimes there are some hiccups and you might be required to do your own debugging.
     
  
   TechTidBits (Blog)  

WP7 has limits on what kind of References you can use

Apr 13

Written by:
Tuesday, April 13, 2010 8:36 PM  RssIcon

Windows Phone 7Trying to create your WP7 application and create proper "tiers," ya how's that work'n out for ya?

Windows Phone 7Today 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.

Add unsupported references

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!

New project types

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.

 Add Silverlight class library

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.

Add reference

Add reference project

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

Do you really want to continue?

NOW you're Done!

Project listing

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.

Changing the version of Silverlight

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.

Silverlight 3 Components you can reference Silverlight 3 Components you can reference

BEAUTIFUL!  You're ready to start using objects in that referenced project!  Now it's time to grab a coffee and get coding!

Tags:
Categories:
Location: Blogs Parent Separator TechTidBits

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

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 
     
  
Copyright 1999-2012 by PCHenry.com   Terms Of Use  Privacy Statement