.NET Blog

Tony Cavaliere

 
My Favourite Albums
  And the Grappa wins.
E-mail me Send mail
Add to Technorati Favorites AddThis Feed Button

Subscribe to Cynot Why Not


Recent posts

Disclaimer

Hey unlike other bloggers I stand by what I say but just in case. The opinions expressed herein are my own except on Tuesday when the second card is not turned up otherwise it ain't worth squat.

© Copyright 2010

Does Silverlight force duplication of code?

I've been playing around with Silverlight and how it works with other project types. So far it appears that regular class libraries cannot be referenced from within a Silverlight application. Give it a try, you should get the following error

Adding Class Library to Silverlight Project

Figure 1: Trying to add a class library to a Silverlight project

 

Likewise when you try to add a Silverlight class library to a web application project you get the following error

Adding Silverlight Class Library to Web Project  

Figure 2: Trying to add a Silverlight class library to a Web Application project

 

Why would you want to do this? Whenever you need to share code between the client and the server. Data Transfer Objects (DTO) come to mind. Although adding a service reference will generate the proxy code and the DTOs but sometimes you may what to forgo the auto-magically generated code by the IDE and code it yourself. Miguel Castro has a presentation on why you might want to do this.

What about validation code? There's a place where we would want the same code running on the client and the server.

I'll be posting this on Silverlight.net forums to see if there is some work around.

Please check this post for a work around.

Guess the movie

I know that you know that I know that you know that that is a dialouge between Confucius and Chuang Tzu.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Silverlight
Posted by CynotWhyNot on Wednesday, September 24, 2008 4:45 PM
Permalink | Comments (10) | Post RSSRSS comment feed

Related posts

Comments

air jordan US

Friday, May 28, 2010 10:39 PM

air jordan

What a great info, thank you for sharing. this will help me so much in my learning.

nike air max 90 US

Friday, July 23, 2010 9:24 AM

nike air max 90

I have been looking for content like this for a research project I am working. Thanks very much. These types of cheap electronic gadgets used to be readily available down at the mall when stores like Brookstone and Sharper Image were around, but when those places closed down I obviously had to come up with a different way to feed my habit.

nike air max 2010 online US

Wednesday, August 25, 2010 5:34 AM

nike air max 2010 online

You got fantastic nice ideas there. I made a research on the topic and got most peoples will agree with your blog. All you have to do is spend some time on the Internet to find stores that offer the items you are most interested in, so start browsing today!

discount sandals 2010 US

Wednesday, August 25, 2010 12:17 PM

discount sandals 2010

Your blog seems interesting.Regards,Kevin.

air max 1 shoes US

Friday, August 27, 2010 1:18 AM

air max 1 shoes

Your blog is perfect, and I like this article. I find the information I need. I think I can find more useful information here, thanks.

gucci brand bags US

Friday, September 03, 2010 12:11 AM

gucci brand bags

There are certainly a lot of details like that to take into consideration. That is a great point to bring up. I offer the thoughts above as general inspiration but clearly there are questions like the one you bring up where the most important thing will be working in honest good faith. I don?t know if best practices have emerged around things like that, but I am sure that your job is clearly identified as a fair game.

discount fendi US

Saturday, September 04, 2010 7:12 AM

discount fendi

Comfortably, the article is in reality the best on this valuable topic. I harmonise with your conclusions and will thirstily look forward to your coming updates. Just saying thanks will not just be sufficient, for the wonderful clarity in your writing. I will instantly grab your rss feed to stay privy of any updates. Fabulous work and much success in your business dealings!

James Shoes US

Monday, September 06, 2010 12:31 PM

James Shoes

I really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people.

nike free running US

Wednesday, September 08, 2010 8:45 PM

nike free running

I really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people.

designer chanel bags US

Thursday, September 09, 2010 6:14 AM

designer chanel bags

Substantially, the article is in reality the sweetest on this precious topic. I harmonise with your conclusions and will thirstily look forward to your upcoming updates. Saying thanks will not just be sufficient, for the phenomenal clarity in your writing. I will directly grab your rss feed to stay abreast of any updates. Pleasant work and much success in your business efforts!

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

Friday, September 10, 2010 4:20 PM