XamlReader.Load 有关问题

XamlReader.Load 问题~
C# code

 Stream stream = Application.GetResourceStream(
                    new StreamResourceInfo(packageStream, null),
                    new Uri("AppManifest.xaml", UriKind.Relative)).Stream;

            String appManifestString = new StreamReader(stream).ReadToEnd();

[color=#FF0000] Deployment deployment = (Deployment)XamlReader.Load(appManifestString);[/color]



其中 appManifestString 读取有内容 为 
XAML code

<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" EntryPointAssembly="Silverlightest_welcome" EntryPointType="Silverlightest_welcome.App" RuntimeVersion="2.0.31005.0">   
     <Deployment.Parts>      
         <AssemblyPart x:Name="Silverlightest_welcome" urce="Silverlightest_welcome.dll" />  
     </Deployment.Parts>  
</Deployment>




红色的地方报错,网上搜索了下 好像是说在silverlight2正式版中,这个实现已经用不了了,关键是不能再用Deployment类来读取appManifest信息,而要自行地用XmlReader来获取。不知道该怎么解决,希望能指点下下 ^_^
新手学习中 ~

------解决方案--------------------
XamlReader对xmlns有要求,所以AppManifest.xaml是不能直接用XamlReader读取的
你可以用Deployment.Current来访问

或者你可以用下面的workaround:
C# code
            string str = @"
<UserControl xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' xmlns:y='http://schemas.microsoft.com/client/2007/deployment'>
<UserControl.Resources>
<y:Deployment x:Key='manifest' EntryPointAssembly='Silverlightest_welcome' EntryPointType='Silverlightest_welcome.App' RuntimeVersion='2.0.31005.0'>   
     <y:Deployment.Parts>      
         <y:AssemblyPart x:Name='Silverlightest_welcome' Source='Silverlightest_welcome.dll' />  
     </y:Deployment.Parts>  
</y:Deployment>
</UserControl.Resources>
</UserControl>";
            
            FrameworkElement obj = System.Windows.Markup.XamlReader.Load(str) as FrameworkElement;
            Deployment d = obj.Resources["manifest"] as Deployment;