Ignacio Soler Garcia
Ignacio Soler Garcia

Reputation: 21855

Some Silverlight and Windows Phone generic questions of a beginner

I'm starting developing Windows Phone applications and even having a somewhat strong background in WPF is my first time with Silverlight. There are some things that I don't understand yet:

  1. Is Silverlight a whole executing engine? Replaces the .NET engine? Or is it a set of Assemblies?
  2. Are Silverlight and .NET assemblies different? Are they compatible?
  3. Why a Winows Phone 8 Project in Visual Studio 2012 shows 3 references but when you look at the csproj there is only a reference to Microsoft.Phone.Controls.dll?

About the point 3, an screenshot to make it more clear:

enter image description here

These 3 references are creared with the following csproj line:

<Reference Include="Microsoft.Phone.Controls, Version=8.0.0.0, Culture=neutral, PublicKeyToken=24eec0d8c86cda1e, processorArchitecture=MSIL" />

Upvotes: 0

Views: 91

Answers (1)

Mats Lann&#233;r
Mats Lann&#233;r

Reputation: 1356

  1. Somewhat simplified you can think of Silverlight as a subset of the full (desktop) .NET framework. More to the point, .NET as available on Windows Phone 8 supports a subset of the "traditional" .NET capabilities. From a WPF perspective you'll notice that there is no support for commands as you would use them in a desktop application for instance, there are also many other smaller differences.
  2. Yes, Silverlight and desktop .NET assemblies are different. While many classes are pretty much identical in the two environments, the actual assemblies are different. You can't for instance take an assembly built using the desktop .NET framework and directly use it on Windows Phone (although if you have the source code it's possible that you can build the source into a Windows Phone assembly)
  3. Not sure what the question is here. I typically just see the reference to Windows Phone as the standard framework assembly in my projects (plus, of course, any other assemblies I choose to reference)

If you're looking at sharing code across .NET platforms (e.g. Desktop, Phone, Win8/RT), you'll want to take a look at Portable Class Libraries. These effectively target a common subset of .NET functionality that can run on all supported platforms. It's a handy way of sharing code between Windows Phone and Windows 8 apps for instance.

Upvotes: 1

Related Questions