检测程序集所需的 Silverlight 版本
如何判断 Silverlight 2 足以完成程序集还是需要 Silverlight 3?
我拥有通过反射可以获得的所有信息(Mono.Cecil)。
SL 3 与 4 的问题相同。
提前致谢。
How can I tell whether Silverlight 2 is sufficient for an assembly or Silverlight 3 is required?
I have all information that is available through reflection (Mono.Cecil).
Same question for SL 3 versus 4.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您无法仅根据类库及其元数据来判断 - 这只能通过 .Xap 中 Silverlight 应用程序的嵌入式清单文件来可靠地确定。
You cannot tell from just the class library and its metadata - this can only be reliably determined from a Silverlight application's embedded manifest file in the .Xap.
这可能正是您正在寻找的:
http://forums.silverlight.net/forums/p/23321/82774.aspx#82774
4 向后兼容 3,3 向后兼容 2。
您应该知道该应用程序是哪个版本的 silverlight
安装和检测:
这个有一个 Javascript 文件,可以检测是否安装了 SL 以及什么版本:
http://blog.mdk-photo.com/post/检测-Silverlight-version-installed.aspx
http://www.apijunkie.com/APIJunkie/blog/post/2009/04/How-to-programmatically-detect-Silverlight-version.aspx
使用 Silverlight 进行版本检测
http://www.scribd.com/doc/14938624/Creating-a-Custom-Silverlight-Installation-Experience
http://blogs.msdn.com /tims/archive/2007/10/29/optimizing-the-silverlight-install-experience.aspx
如果您运行的 SL 版本错误,Thge GAC 还会在编译期间通知您。通常当您安装了 Silverlight 工具并尝试编译应用程序时。例如,您的程序集是在版本 3 中创建的,并且您使用的控件仅在版本 3 中可用,您必须安装 SL 3 工具,否则构建将出错让您知道。
有关 Silverlight 程序集的更多信息:
http ://www.netfxharmonics.com/2008/12/Reusing-NET-Assemblies-in-Silverlight
http://nerddawg.members.winisp.net/AssemblySniffer/
This might be exactly what you are looking for:
http://forums.silverlight.net/forums/p/23321/82774.aspx#82774
4 is backward compatible with 3, 3 is backward compatiable with 2.
You should know which version of silverlight the app is built in.
Installation and detection:
This one has a Javascript file that will detect if SL is installed and What version:
http://blog.mdk-photo.com/post/Detecting-Silverlight-version-installed.aspx
http://www.apijunkie.com/APIJunkie/blog/post/2009/04/How-to-programmatically-detect-Silverlight-version.aspx
Version detection with Silverlight
http://www.scribd.com/doc/14938624/Creating-a-Custom-Silverlight-Installation-Experience
http://blogs.msdn.com/tims/archive/2007/10/29/optimizing-the-silverlight-install-experience.aspx
Thge GAC will also notify you durring compile if you are running the wrong version of SL. Typically when you have Silverlight tools installed and try to compile an app. For instance your assembly is created in version 3 and you use a control that is only available in 3, you will have to have SL 3 tools installed or the build will error letting you know.
More on the Silverlight assemblies:
http://www.netfxharmonics.com/2008/12/Reusing-NET-Assemblies-in-Silverlight
http://nerddawg.members.winisp.net/AssemblySniffer/