Sharepoint学习笔记—习题系列--70-576习题解析 -(Q135-Q137)
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文件夹下(目录位置如图)。

<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)的更多相关文章
- Sharepoint学习笔记—ECM系列—文档列表的Metedata Navigation与Key Filter功能的实现
如果一个文档列表中存放了成百上千的文档,想要快速的找到你想要的还真不是件容易的事,Sharepoint提供了Metedata Navigation与Key Filter功能可以帮助我们快速的过滤和定位 ...
- Sharepoint学习笔记—ECM系列--文档集(Document Set)的实现
文档集是 SharePoint Server 2010 中的一项新功能,它使组织能够管理单个可交付文档或工作产品(可包含多个文档或文件).文档集是特殊类型的文件夹,它合并了唯一的文档集属性以及文件夹和 ...
- Sharepoint学习笔记—习题系列--70-576习题解析 --索引目录
Sharepoint学习笔记—习题系列--70-576习题解析 为便于查阅,这里整理并列出了70-576习题解析系列的所有问题,有些内容可能会在以后更新. 需要事先申明的是: 1. ...
- Sharepoint学习笔记—习题系列--70-573习题解析 --索引目录
Sharepoint学习笔记—习题系列--70-573习题解析 为便于查阅,这里整理并列出了我前面播客中的关于70-573习题解析系列的所有问题,有些内容可能会在以后更新, ...
- Deep Learning(深度学习)学习笔记整理系列之(五)
Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...
- Deep Learning(深度学习)学习笔记整理系列之(八)
Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...
- Deep Learning(深度学习)学习笔记整理系列之(七)
Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...
- Deep Learning(深度学习)学习笔记整理系列之(六)
Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...
- Deep Learning(深度学习)学习笔记整理系列之(四)
Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...
- Deep Learning(深度学习)学习笔记整理系列之(三)
Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...
随机推荐
- 手把手教你用nodejs+SQL Server2012做增删改查
1.开发工具WebStorm 10.0.4 2.打开WebStorm 10.0.4新建项目:
- MVC4做网站后台:用户管理 —用户
这块进行用户管理,可以浏览.查询已注册的用户,修改用户资料,删除用户等.没有做添加用户,不知是否必要.列表页还是使用easyui的datagrid.这个思路跟用户组的方式差不多. 1.接口Interf ...
- Hibernate的数据删除,更改
其他未给出代码,请参考上一篇.... 一.数据的删除 方法1.从“多”的一方进行数据的删除 books.hbm.xml文件不变: <many-to-one name="publishe ...
- M端总结
最近在项目开发过程中涉及到了移动端,现在对此进行总结. 在此次M端的开发过程中,遇到了许多问题,在此进行一次总结,希望大家在以后的开发过程中能尽量规避类似的问题,提高开发效率和代码质量.一.布局1.移 ...
- Java基础--反射机制的知识点梳理
什么是反射? 正常编译执行java文件时,会生成一个.class文件,反射就是一个反编译的过程,它可以通过.class文件得到一个java对象.一个类会有很多组成部分,比如成员变量,成员方法,构造方法 ...
- Java进击C#——语法之面向对象
本章简言 上一章笔者讲到关于ADO.NET相关的知识,知道了如何去访问数据库.本章将来讲关于面向对象的思想.不管在JAVA还是在C#面向对象思想的重要性都是占了一个很大的成份.往往他就像呼吸一样子,更 ...
- 离线安装swashbuckle(webapi自动文档及测试工具)
1.找到已经成功安装过的项目根目录的packages文件夹拷贝到新的项目的根目录 2.vs设置nuget程序包源 将源:地址改为新项目的packages文件夹 3.重新编译并修改代码 右键项目-> ...
- 【nodejs笔记3】Express基本用法,和路由控制,和模板渲染ejs
1. 路由控制的工作原理 //routes/index.js中的代码//访问主页时,调用ejs模板引擎,渲染index.ejs模板文件,生成静态页面,并显示在浏览器中.router.get('/', ...
- 转载:《TypeScript 中文入门教程》 7、模块
版权 文章转载自:https://github.com/zhongsp 建议您直接跳转到上面的网址查看最新版本. 关于术语的一点说明: 请务必注意一点,TypeScript 1.5里术语名已经发生了变 ...
- 转载:《TypeScript 中文入门教程》 3、接口
版权 文章转载自:https://github.com/zhongsp 建议您直接跳转到上面的网址查看最新版本. 介绍 TypeScript的核心原则之一是对值所具有的shape进行类型检查. 它有时 ...