Sharepoint学习笔记—习题系列--70-576习题解析 -(Q135-Q137)

时间:2023-02-27 07:51:03

Question  135
 You work for a software company that sells Web Parts to customers. You designed the first version of a Web Part named Weather 1.0. The company has already sold several hundred licenses of the Web Part. You designed a new solution package for Weather 2.0. Some customers who are already using Weather 1.0 will install Weather 2.0 in the same Web application as Weather 1.0. You need to design your package so that the functionality of Weather 1.0 will not be affected by the installation of Weather 2.0 in the same Web application. Which approach should you recommend?
A. Use the same assembly name and namespace for Weather 2.0 that you used for Weather 1.0. Create a new .web part file. Increment the version number in the .web part file.
B. Use the same assembly name and namespace, but increment the version number of the assembly package. Use the same .web part file that you used for Weather 1.0.
C. Use the same assembly name and namespace, but increment the version number of the assembly package. Configure assembly binding redirection from version 1.0 of the assembly to version 2.0. Use the same .web part file that you used for Weather 1.0.
D. Use the same assembly name and namespace, but increment the version number of the assembly package. Create a new .web part file.

解析:
  你为一家专门为客户提供Web part产品的公司开发了一个名为Weather 1.0版本的Web Part,此公司已经卖出去了几百套此Web Part, 你现在开发了此Web Part的新版本Weather 2.0,以前已经使用Weather 1.0的老客户需要在他们应用的环境中安装Weather 2.0,你需要保证Weather 1.0的运行功能不会因为Weather 2.0的安装受影响。你该采用何种措施来达成此目的呢?
   顾名思义,WebPart就是组成网页(Web)的部件(Part),它是SharePoint站点WebPartPage的基本构建块。直观的看,在SharePoint网站的页面上,数据的显示、数据的编辑,都是通过一个一个的WebPart来完成的;实质上,WebPart是ASP.NET自定义控件,都是由一个WebPart说明文件(.dwp)和WebPart程序集(.dll)组成。
   如果你对早先部署的WebPart程序集(.dll)进行了升级,那么原先添加的Web Part就会停止工作,因为Sharepoint找不到针对原先Web part的程序集了。【这也是本题要求尽量避免的】
   由于.NET支持并行存储和执行同一程序集的不同版本,这种支持内置于运行时基础结构中。 因为强名称程序集的版本号是其标识的一部分,所以运行时能够在全局程序集缓存中存储同一程序集的多个版本,并且在运行时加载这些程序集。根据这一特性,我们就可以创建一个新的Feature,但使用相同的程序集签名和不同的版本号,这样我们就解决了WebPart程序集(.dll)升级后找不到原程序集而造成的已安装Web Part运行失效的问题。 而备选项中,选项D符合这样的操作。
  选项A. 修改.web part文件中的Version并不影响程序集的Version,如果程序集的Version不变就会覆盖掉原来的WebPart程序集(.dll),造成已部署Web Part的停工,所以排除。
  选项B. 如果使用的是与Weather 1.0相同的.web part(内有Web Part版本号)文件,那还叫什么功能升级呢?所以排除。
  选项C. 犯了与选项B一样的错误,使用的是与Weather 1.0相同的.web part文件。所以排除。

因此本题答案应该选  D

参考 
http://blogs.msdn.com/b/andrasg/archive/2011/07/19/the-good-solution-for-versioning-sharepoint-2010-webparts.aspx
http://msdn.microsoft.com/en-us/library/cc768621(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/ff407219(v=office.14).aspx
http://msdn.microsoft.com/en-us/library/ms227561.aspx
http://msdn.microsoft.com/zh-cn/library/vstudio/fdhkd3a5.aspx

Question  136
 You are designing a SharePoint 2010 application. You have a requirement to allow access to a Microsoft  Windows .NET Framework assembly across multiple Web applications in a farm. An assembly element has been added to the solution manifest (manifest.xml). You need to ensure that the deployment of the assembly meets the requirements. Which approach should you recommend?
A. Specify a Deployment Target of GlobalAssemblyCache.
B. Specify a Deployment Target of Web Application.
C. Specify a Location of GlobalAssemblyCache.
D. Specify a Location of Web Application.

解析:
  你开发了一个Sharepoint2010应用程序,在你开发的解决方案的manifest.xml中你加入了程序集元素(assembly element),你需要保证在场内的不同Web Application之间可以访问这个开发的Microsoft  Windows .NET Framework的程序集,你该如何部署你的开发才能满组上述需要呢?
  本题使用到了解决方案文件manifest.xml:解决方案指令清单(通常称为 manifest.xml)存储在解决方案文件的根位置。此文件定义要处理的功能、网站定义、资源文件、Web 部件文件和程序集的列表。 在manifest.xml的assembly元素中指定要包含在解决方案中的程序集。

<Solution SolutionId="4AFC1350-F354-4439-B941-51377E845F2B" xmlns="http://schemas.microsoft.com/sharepoint/">
<FeatureManifests>
<FeatureManifest Location="FeatureLibrary\feature.xml"/>
</FeatureManifests>
<TemplateFiles>
<TemplateFile Location="ControlTemplates\Featurelibraryform.ascx"/>
</TemplateFiles>
<RootFiles>
<!-- These files go into the 12\ directory and can be used for Web services and global resources -->
<RootFile Location="ISAPI\MyWebService.asmx">
</RootFiles>
<Assemblies>
<Assembly DeploymentTarget="GlobalAssemblyCache"
Location="ms.samples.sharepoint.myFeature.dll"/>
</Assemblies>
</Solution>

其中DeploymentTarget属性:为可选属性,类型为 Text。程序集部署的首选目标。将程序集复制到由 DeploymentTarget 属性(对于 Web 应用程序)或全局程序集缓存(对于服务器场)指定的目标。可能的值:
GlobalAssemblyCache   如果程序集是一种场功能,则将其复制到全局程序集缓存。
WebApplication   如果程序集是一种 Web 应用程序功能,则将其复制到虚拟服务器的 bin 目录。
 由于本题要求在场内的不同Web Application之间可以访问这个开发的Microsoft  Windows .NET Framework的程序集,所以应该部署在全局程序集缓存中,即此属性值为GlobalAssemblyCache 。

因此本题答案应该选  A

参考 
http://msdn.microsoft.com/zh-cn/library/ms442108(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/ms468837.aspx

Question  137
 You are designing a SharePoint 2010 application. You need to plan the deployment of a user control named MyControlTemplate.ascx as a control template. What should be added to the solution manifest (manifest.xml) to achieve this goal?
A. Add a Template File element, specifying a Location of MyControlTemplate.ascx.
B. Add a Template File element, specifying a Location of Control Templates\MyControlTemplate.ascx.
C. Add a Root File element, specifying a Location of MyControlTemplate.ascx.
D. Add a Root File element, specifying a Location of Control Templates\MyControlTemplate.ascx.

解析:
  你想要把一个名为MyControlTemplate.ascx的用户自定义控件部署成一个控件模板,你该如何添加此元素到解决方案的manifest.xml文件中呢?
  此题的备选项涉及解决方案指令清单(manifest.xml)中的Template File元素与Root File元素。
 Root File元素: 指定将解决方案文件复制到的根路径。使用此元素可部署由多个功能共享的本地化资源。共享的本地化资源位于 %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\Resources 文件夹中。例如,以下 XML 部署三个共享的本地化资源文件。

<RootFiles>
<RootFile Location="Resources\wingtip.resx" />
<RootFile Location="Resources\wingtip.en-US.resx" />
<RootFile Location="Resources\wingtip.es-ES.resx" />
</RootFiles>

Template File元素:指定要包括在该解决方案中的模板文件。Sharepoint的模板文件一般都是放在Template目录下,而控件模板则放在此目录下的ControlTemplates文件夹下(目录位置如图)。

Sharepoint学习笔记—习题系列--70-576习题解析 -(Q135-Q137)

 <TemplateFiles>
<TemplateFile Location="ControlTemplates\Featurelibraryform.ascx"/>
</TemplateFiles>

因此本题答案应该选 B

参考 
http://msdn.microsoft.com/zh-cn/library/ms450312(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/aa543424(v=office.14).aspx

Sharepoint学习笔记—习题系列--70-576习题解析 -(Q135-Q137)的更多相关文章

  1. Sharepoint学习笔记—ECM系列—文档列表的Metedata Navigation与Key Filter功能的实现

    如果一个文档列表中存放了成百上千的文档,想要快速的找到你想要的还真不是件容易的事,Sharepoint提供了Metedata Navigation与Key Filter功能可以帮助我们快速的过滤和定位 ...

  2. Sharepoint学习笔记—ECM系列--文档集&lpar;Document Set&rpar;的实现

    文档集是 SharePoint Server 2010 中的一项新功能,它使组织能够管理单个可交付文档或工作产品(可包含多个文档或文件).文档集是特殊类型的文件夹,它合并了唯一的文档集属性以及文件夹和 ...

  3. Sharepoint学习笔记—习题系列--70-576习题解析 --索引目录

        Sharepoint学习笔记—习题系列--70-576习题解析  为便于查阅,这里整理并列出了70-576习题解析系列的所有问题,有些内容可能会在以后更新. 需要事先申明的是:     1. ...

  4. Sharepoint学习笔记—习题系列--70-573习题解析 --索引目录

                  Sharepoint学习笔记—习题系列--70-573习题解析 为便于查阅,这里整理并列出了我前面播客中的关于70-573习题解析系列的所有问题,有些内容可能会在以后更新, ...

  5. Deep Learning(深度学习)学习笔记整理系列之(五)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  6. Deep Learning(深度学习)学习笔记整理系列之(八)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  7. Deep Learning(深度学习)学习笔记整理系列之(七)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  8. Deep Learning(深度学习)学习笔记整理系列之(六)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  9. Deep Learning(深度学习)学习笔记整理系列之(四)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  10. Deep Learning(深度学习)学习笔记整理系列之(三)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

随机推荐

  1. Linux安装jdk

    查看Java的版本命令:java -version 查看java版本的方法是:运行--->cmd,输入java –version.注意: java命令后是有个空格的,-version表示参数而已 ...

  2. Winform TextBox中只能输入数字的几种常用方法&lpar;C&num;&rpar;

    方法一: private void tBox_KeyPress(object sender, KeyPressEventArgs e) { ; //禁止空格键 )) return; //处理负数 if ...

  3. 持续集成之戏说Check-in Dance

    尽管Thoughtworks的首席科学家Martion folwer 为“持续集成 ” 下了定义,但由于自身背景与经历的不同,每个人对其都有不同的理解.从狭义上讲,持续集成可以认为是一种基于某种或者某 ...

  4. Spring 定时任务之 &commat;Scheduled cron表达式

    一个基于Spring boot的一个demo: Java配置中开户对Scheduled的支持 import org.springframework.context.annotation.Configu ...

  5. UVA - 10131Is Bigger Smarter&quest;(DAG上的DP)

    题目:UVA - 10131Is Bigger Smarter? (DAG) 题目大意:给出一群大象的体重和IQ.要求挑选最多的大象,组成一个序列.严格的体重递增,IQ递减的序列.输出最多的大象数目和 ...

  6. java RTTI笔记 之Class学习笔记(摘自java编程思想)

    1.java 使用Class对象来执行其RTTI.java 中每个类在编译后都会对应产生一个Class对象(更恰当地说是被保存在一个同名的.class文件中),甚至void和基本类型也都对应一个cla ...

  7. tomcat端口冲突,多个tomcat同时启动问题

    一台PC机上安装了两个tomcat,需要同时启动,每个tomcat上跑一个程序,但是现在提示端口号冲突,需要手动更改. 需要修改/conf/server.xml四个地方: 1.<Server p ...

  8. Python 中的线程-进程2

    原文:https://www.cnblogs.com/i-honey/p/7823587.html Python中实现多线程需要使用到 threading 库,其中每一个 Thread类 的实例控制一 ...

  9. UVa 557 汉堡

    https://vjudge.net/problem/UVA-557 题意: 有n个牛肉堡和n个鸡肉堡给2n个孩子吃.每个孩子在吃之前都要抛硬币,正面吃牛肉堡,反面吃鸡肉堡.如果剩下的所有汉堡都一样, ...

  10. WinForm各浏览器内核控件

    WebKit.NET webkit-sharp CefSharp awesomium OpenWebKitSharp geckofx MozNet Web Component