Export (0) Print
Expand All

ASP.NET Ajax Library and Script#

Starting with version 3.5, the Windows Live Messenger Web Toolkit is built with the ASP.NET Ajax Library. This change should not affect most applications. If you develop your application with Script#, or if your application uses features of the Script# runtime library, you may need to update your application to be compatible with the ASP.NET Ajax Library.

Prior to version 3.5, the Windows Live Messenger Web Toolkit worked with the Script# runtime library ('sscorlib.dll').

If you develop your application with Script#, or if you use Script# runtime library functionality in your application, the following examples can help you determine whether you need to update your application.

Your Application is not Developed with Script#

Even if your application is not developed with Script#, it is possible that it has a dependency on the Script# runtime library.

Determine if Your Application Uses Script# Runtime Features

Here are some examples of Script# runtime library features that you might be using in your application. You can also learn more details in the Script# documentation.

<Type>.Parse Methods

If you use the Parse function in your application, you are using the Script# runtime library. These methods are not available with the ASP.NET Ajax Library.

Enum.toString

If you use the toString function on values of an enumerated type in your application, for example, on a Microsoft.Live.Messenger.PresenceStatus value such as Contact.Presence.Status you are using the Script# runtime library. The ASP.NET Ajax Library supports the toString function on the enumerated type itself. In the preceding example, you can use the following code where c is a Contact object.

Microsoft.Live.Messenger.PresenceStatus.toString(c.get_presence().get_status());
ScriptHost and ScriptLoader

ScriptHost and ScriptLoader are not available in the ASP.NET Ajax Library.

Array Operations

Script# supports Array operations, such as insert, directly on the Array objects. In the ASP.NET Ajax Library, these operations are supported on the Array class instead. For example, suppose that your application has an Array named 'a'. The Script# runtime library supports an operation such as the following.

a.insert(index, item);

With the ASP.NET Ajax Library, you would perform the same operation as follows.

Array.insert(a, index, item);
Date Formatting

If you use the Windows Live Messenger Library and do not use the Messenger UI Controls, then you may find that the ASP.NET Ajax Library supports fewer options in date-time formatting than the Script# runtime library. If you use the Messenger UI Controls, then you should continue to be able to use the same date-time formatting options.

Utility Classes

The following classes are in the Sys namespace instead of the global namespace.

  • Debug
  • EventArgs
  • IDisposable
  • StringBuilder

If you use any of those classes, you need to update your code to reference the Sys namespace.

Your Application Uses Script# Runtime Features

If you use any of the features in the previous section, then you may want to remove dependence on the features in your application or follow suggestions in the previous section.

Continue Using the Script# Runtime Library

If you want to continue using Script# runtime library features, then we recommend that you use the Windows Live Messenger Web Toolkit loader to load the Script# runtime library. The following example shows how to load the library.

Microsoft.Live.Core.Loader.load(['scriptsharp'], null);

See Loading the Windows Live Messenger Web Toolkit for more information on the loader.

Your Application is Built with Script#

If you build your application with Script#, then you can determine if you need to make any changes based on the following.

Your Application Uses aacorlib.dll

If you compile your Script# application to use the ASP.NET AJAX runtime library 'aacorlib.dll', then your application should continue to run without any changes.

Your Application Uses sscorlib.dll

If you compile your Script# application to use the Script# runtime library 'sscorlib.dll', then your application must load the Script# runtime after it loads the Messenger Web Toolkit. To ensure that 'sscorlib.js' is loaded after the Messenger Web Toolkit, we recommend the following steps.

  1. If you currently load 'sscorlib.js' explicitly with a <SCRIPT> tag, then use the Windows Live Messenger Web Toolkit loader to load it, as shown in the following example.
    Microsoft.Live.Core.Loader.load(['scriptsharp'], null);
    
  2. If you currently load the Windows Live Messenger Library by loading the 'messenger.js' file, then use the Windows Live Messenger Web Toolkit loader to load the toolkit. To load both the Windows Live Messenger Library and 'sscorlib.js' with the loader, use the following example.
    Microsoft.Live.Core.Loader.load(['messenger.core', 'scriptsharp'], null);
    

Your application should run without any issues by following the steps above. If you upgrade your application to Version 3.5, and you see issues when you load the Script# runtime library as suggested in the previous sections, please contact the MSDN development forum.

Show:
© 2014 Microsoft