views:

57

answers:

2

I am working on a silverlight 3 site using expression blend 3 (silverlight project + website option in expression blend).

I need to add some business logic for the controls to consume (eg get ints for my gauges to pick up). If I add code to the class library, I cannot use all the namespaces and types - I assume because of the CoreCLR's limitations.

If I add the classes to the website itself, then I can see all the types but I can't seem to find/call the classes despite visibility levels and references all being added and correct (namespace ... is all correct).

What is the recommended way of adding logic to the structure of my project? If I add a completely seperate class library (say for example using Visual Studio) and then make services for my controls to use to consume the class library's features, can I see all types/namespaces in the framework?

Thanks

A: 

You should look at the .NET RIA Services to share business logic between server and client. See this article by Brad Abrams, his series of blog posts, and his video from Mix 2009.

Michael S. Scherotter
Will this let me use the entire CLR? I don't mind how I should structure my project now to be able to see the entire CLR, as long as this is somehow possible.
dotnetdev
A: 

If you add a standard library project you will not be able to use it inside Silverlight, if you add a Silverlight library project you will have the same limitations that you are finding in the Silverlight app itself.

Your logic, if you need it to run clientside in the Silverlight app, will have to limit itself to what is available in the Silverlight versions of the .NET libraries. However this still represents a significant coverage of the standard .NET libraries especially from the perspective of clientside UI application.

What specific .NET libraries are you unable to access?

AnthonyWJones
I want to work with things like performance counters (from the local machine), WMI, etc.
dotnetdev
From with in Silverlight? Not going to happen, Silverlight runs in a "Security Sandbox" and those are exactly the sorts of things we wouldn't want Silverlight apps to be able to do. If they could most sensible sysadmins would blacklist the Silverlight plughin.
AnthonyWJones