From:http://silverlight.net

Introduction

important

This topic applies to Silverlight version 1.1. It has not been updated for Silverlight version 2.

Microsoft Silverlight projects must reference the .NET Framework assemblies that are installed with Silverlight instead of those that are installed with Visual Studio. You can customize the Visual Studio Object Browser to view only the Silverlight assemblies.

note

The Silverlight assemblies include both members that can be used in Silverlight-based applications and members that can be referenced only by .NET Framework code. The members that cannot be used in Silverlight-based applications are identified by the presence of the SecurityCriticalAttribute attribute. The presence of this attribute is not visible in the Object Browser, so you cannot discern which members can be used for Silverlight-based applications. However, you will see the prefix "[SECURITY CRITICAL]" in the IntelliSense view of members that have the SecurityCriticalAttribute. The Silverlight documentation also specifies which types and members are security-critical. If you use a security-critical member in your code, you will get an exception when you attempt to execute that member in a Silverlight-based application.

Prerequisites (available from the Silverlight download site):

  • Silverlight version 2.

  • Microsoft Visual Studio 2008.

  • Silverlight Tools Beta for Visual Studio 2008.

To select the Silverlight assemblies to view

  1. On the View menu, click Object Browser to open the Visual Studio Object Browser.

  2. In the Browse combo box, click Edit Custom Component Set. The Edit Custom Component Set dialog box will open.

  3. In the Edit Custom Component Set dialog box, click the Browse tab, and browse to the Program Files\Microsoft Silverlight folder.

  4. Select all the files. Click the Add button, and then click OK. The Object Browser automatically determines which assemblies contain managed code. A message box that identifies the unmanaged assemblies is displayed (these assemblies are not added), and all the managed assemblies appear in the custom component set.

To view a Silverlight assembly

  1. In the Object Browser, click the plus sign next to an assembly name to view the namespaces and types in that assembly.

    When you click a type to view its members, remember that all members are shown, including security-critical members that can be accessed only from library code. To avoid the use of security-critical members when creating a Silverlight-based application, look for the security-critical warning in IntelliSense.

posted on 2008-04-14 23:27  zyshang  阅读(314)  评论(0)    收藏  举报