当前位置:编程学习 > C#/ASP.NET >>

dll重新编译后依赖的组件报错(即使未修改源码)

源代码未做任何修改

使用下面的源代码:
Microsoft SDKs\Silverlight\v4.0\Toolkit\Apr10\Source\Source code.zip\System.Windows.Data
重新编译:
Microsoft SDKs\Silverlight\v4.0\Libraries\Client\System.Windows.Data.dll

用编译好的System.Windows.Data.dll替换掉原始的:
Microsoft SDKs\Silverlight\v4.0\Libraries\Client\System.Windows.Data.dll

结果就是依赖System.Windows.Data.dll的DataGrid报错

我的解决办法是使用DataGrid的源代码:
Microsoft SDKs\Silverlight\v4.0\Toolkit\Apr10\Source\Source code.zip\System.Windows.Controls.Data
重新编译,编译前将System.Windows.Data.dll引用去掉,改为引用System.Windows.Data源代码项目,编译后同时替换掉:
Microsoft SDKs\Silverlight\v4.0\Libraries\Client\System.Windows.Controls.Data.dll
Microsoft SDKs\Silverlight\v4.0\Libraries\Client\System.Windows.Data.dll

这样DataGrid可以正常工作,修改了System.Windows.Data源代码这样处理也OK。

请问这是什么原因造成的,如果还有其他组件引用System.Windows.Data.dll,应该还会报错?


这是Silverlight4的处理,下面还要处理Silverlight5,麻烦的是Silverlight5没有提供System.Windows.Data.dll和System.Windows.Controls.Data.dll的源代码。

用ildasm反编译dll为IL文件,再用ilasm命令编译为dll,未做任何修改(只是将.publickey那节干掉了,否则ilasm编译报错)。对System.Windows.Data.dll和System.Windows.Controls.Data.dll作了同样的处理,替换掉相应目录下的dll文件,DataGrid报错问题再次出现。这次没有源代码了,Silverlight4的处理方法行不通,这个问题如何解决?(如果只替换System.Windows.Controls.Data.dll,不替换System.Windows.Data.dll,DataGrid是可以正常工作的,证明编译后的dll是OK的。)

我这样做的目的是需要修改System.Windows.Data.dll,用以解决DataGrid中文排序问题,Silverlight3正常,4、5都不能按拼音排序,大爷的微软
silverlight 源代码 --------------------编程问答-------------------- DataGrid引用的ms签名的类库,你用自己编译的类库替代它,虽然名字都一样,但是身份不一样,不是同一个东西,人家不认。
补充:.NET技术 ,  .NET Framework
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,