Skip to main content

Microsoft Silverlight

Answered Question How to reference normal project from Silverlight?RSS Feed

(0)

techwave
techwave

Member

Member

4 points

3 Posts

How to reference normal project from Silverlight?

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
swildermuth

Star

Star

8320 points

1,546 Posts

Re: How to reference normal project from Silverlight?

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.

(If this has answered your question, "Mark as Answer")

Shawn Wildermuth
C# MVP, MCSD, Speaker and Author

Silverlight 3 Workshop
Miami, FL: Oct 12-14th
Portlant, OR: Dec 2-4th
Atlanta, GA: Dec 7-9th
http://silverlight-tour.com

luisabreu
luisabreu

Participant

Participant

1676 points

612 Posts

Re: How to reference normal project from Silverlight?

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 :)

techwave
techwave

Member

Member

4 points

3 Posts

Re: How to reference normal project from Silverlight?

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!

swildermuth
swildermuth

Star

Star

8320 points

1,546 Posts

Answered Question

Re: Re: How to reference normal project from Silverlight?

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.

(If this has answered your question, "Mark as Answer")

Shawn Wildermuth
C# MVP, MCSD, Speaker and Author

Silverlight 3 Workshop
Miami, FL: Oct 12-14th
Portlant, OR: Dec 2-4th
Atlanta, GA: Dec 7-9th
http://silverlight-tour.com

techwave
techwave

Member

Member

4 points

3 Posts

Re: Re: Re: How to reference normal project from Silverlight?

I see.  Thanks a lot.

I better turn the application to a fully service-oriented one, although it take time.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities