Skip to main content
Home Forums Silverlight Programming Programming with .NET - General How to reference normal project from Silverlight?
5 replies. Latest Post by techwave on July 11, 2007.
(0)
techwave
Member
4 points
3 Posts
07-10-2007 12:12 PM |
I have a 3 tier ASP.NET application. I would like to change the presentation layer to Silverlight. However, when I write the Silverlight project and reference my business objects, I get message saying that "Silverlight project can only reference other Silverlight project". How can I link up the two layers then?
Thanks
swildermuth
Star
8320 points
1,546 Posts
07-10-2007 3:12 PM |
Silverlight is run in the Browser so you do not want your business objects typically be be run from within the browser. Your business objects are using the full .NET CLR versus the mini-CLR in Silverlight. I would expect that you could expose web services that return business data to Silverlight, but you can't use full .NET CLR assemblies with teh mini-CLR.
luisabreu
Participant
1676 points
612 Posts
07-10-2007 6:46 PM |
hello.
Shawn is right: you cannot use "normal" compiled dlls with silverlight. what you can do is create a new silverlight control project and then add links to the C# files. doing this will compile your code agains the mini-clr and if you're lucky, it might even work :)
07-10-2007 11:52 PM |
Thanks.
But how about the framework? I have my framework assemblies handling exception, logging ..etc. I have to convert all these to Silverlight project? That is quite a lot of work!
07-11-2007 12:07 AM |
Yes it is...more likely is that you would continue to use yoru assemblies on the server side and just send down data to the client to use in Silverlight. Its not appropriate usually to run your code in the browser. For example, where are you going to do the logging? In the browser you don't have rights to write out to the files system (except for a small Isolated Storage allocation). Do your business objects access a database? If so, you'd have to open your database across your Internet connection to make it work...which is a horribly bad idea.
So the "right" answer is to treat Silverlight as a client-side technology...just like HTML.
But perhaps what you're after is different. Perhaps you want a XAML-based UI within an enterprise application...in that case use click-once deployed WPF instead. Silverlight is all about reach (running compelling applications across the Internet), not richness of API. If you have some control over the client-systems, Click-once deployed WPF is a much better solution...and a much richer API.
07-11-2007 3:02 AM |
I see. Thanks a lot.
I better turn the application to a fully service-oriented one, although it take time.