Avalon on XP

9/4/2004 2:49:12 PM

Avalon on XP

After the announcement that Avalon would be available on XP, I actually tried to see if I could actually build and run an Avalon app in XP, using the relevant dlls from the WinHEC Longhorn build. Using the PDC bits, I had actually been able to run an Avalon app in XP last October, as long as it didn't use certain features like video, but those bits are no longer available in MSDN subscriptions.

I copied over the dlls from C:\windows\Microsoft.NET\windows directory in the Longhorn virtual machine to my XP machine. I only really needed perhaps PresentationCore.dll, PresentationFramework.dll, WindowsBase.dll, and possibly WindowsUIAutomation.dll as these were my only references in my C# project. I gac'ed the dll's and also created an .local directory.  A little known secret in Windows is that you can force which dlls are loaded by creating an <appname>.exe.local subdirectory (containing all the dlls your app uses) in same directory as the application and this will override both the GAC and the regular system search path for dlls. This avoids DLL hell and doesn't require config files.

I then created a C# project to build a "Hello World" Avalon app. Building a XAML page would have involved more steps.

using System.Windows;
using System.Windows.Controls;

public class Program
{
     public static void Main(string[] args)
     {
          Application app = new Application();
          Window window = new Window();
          Text text = new Text();
          text.TextContent = "Hello Word";
          window.Content = text;
          window.Show();
          app.Run();
     }
}

The application compiled and ran; unfortunately, upon executing window.Show(), the debugger indicated that "milcore.dll" could not be found, and no copying of milcore.dll and related Longhorn systems dlls into various directories could eliminate this error. My guess is that the WinHEC build diverged so much from the PDC build, that running Avalon windows under XP was no longer possible. This is understandable, since Avalon windows rely on a new type of HWNDs introduced in Longhorn, MIL (for Media Integration Layer) HWNDs. MIL HWNDs are built with DirectX APIs and do not longer support GDI operations.

If anyone has any suggestions, please leave a comment.

Comments

 

Navigation

Categories

About

Net Undocumented is a blog about the internals of .NET including Xamarin implementations. Other topics include managed and web languages (C#, C++, Javascript), computer science theory, software engineering and software entrepreneurship.

Social Media