Question 19
You are designing a custom SharePoint 2010 solution package. It will include a feature that contains a Web Part,which requires a custom assembly for its functionality. You need to design the feature based on the following requirements:
.The Web Part must be a partial trust application and support a custom Code Access Security (CAS) policy.
.The solution package must be deployed without the need of farm-level administrator permissions.
Which approach should you recommend?
A. Create the Web Part feature and deploy the required assembly to the bin directory of only the Web applications that require it. Then delegate administration to the site administrator. Lastly, create a custom CAS policy file and point to it the web.config file of the application.
B. Create the Web Part feature assembly with a strong name and deploy it using a .wsp file to the _app_bin directory of all Web applications where it is needed. Then activate it using delegated administration.
C. Create an assembly with a strong name and deploy it to the global assembly cache at the farm level. Activate the feature at the site collection level with delegated administration.
D. Create the Web Part feature as a sandboxed solution.

解析:
 本题需要你创建一个包含有WebPart的解决方案,此Webpart需要基于客户定义的程序集实现其功能。解决方案需要满足如下条件:
  要求1. 此WebPart必须实现的是部分信任的应用,并支持代码访问安全性策略(CAS)
 要求2.此解决方案不需要场管理员的支持就能部署。
 看到上面的要求,尤其是第2个要求,马上就应该反应出SandBox Solution了。本题的备选项只有选项D使用了沙盒方案,所以应该是选项D。
  但是我们还是需要过一遍其它备选项以肯定我们的判断:
  选项 A. Create the Web Part feature and deploy the required assembly to the bin directory of only the Web applications that require it. Then delegate administration to the site administrator. Lastly, create a custom CAS policy file and point to it the web.config file of the application.
本选项把WebPart部署到Bin目录,我们来了解下这种情况。
在 SharePoint 网站内,可以将 Web 部件程序集部署到多个位置。
1.解决方案库 – 解决方案库是使用沙盒解决方案部署 Web 部件时的建议位置。默认情况下,它为 Web 部件提供监视和安全性。
2. bin 目录 — bin 目录是一个存储在 Web 应用程序根目录下的文件夹。在 Internet Information Services (IIS) 中创建网站时将确定此文件夹的位置。在 SharePoint Foundation 中,可以通过管理中心网站或通过在 IIS 管理器中手动创建新网站来实现此目的。
 重要信息:如果 bin 目录不存在,您必须手动添加一个 bin 目录。请不要在本地 _app_bin 目录中存储 Web 部件,此目录是专为 Microsoft 保留的。
3.全局程序集缓存 — 可用于部署已签名程序集的全局位置。利用全局程序集缓存,可以跨多个应用程序共享程序集。全局程序集缓存将随 .NET 运行库一起自动安装。通常,组件将存储在 C:\WINNT\Assembly 文件夹中。
其中,针对本选项所采取的第2种方式即bin目录方式,其优点是:默认情况下,程序集以部分信任的形式运行。从该目录运行的代码具有较低级别的代码访问安全性 (CAS) 权限。由于管理员必须明确提升已向 Web 部件授予的权限以使该部件能够正常运行,因此他们通常更愿意程序集在 bin 目录中通过已知的必需 CAS 权限集运行。每个 Web 应用程序都有一个 bin 目录。这样,就可以隔离特定 Web 应用程序的代码。但缺点是:为了使此 Web 部件能够在多个 Web 应用程序中运行,您必须将此 Web 部件部署到全局程序集缓存中。【这句就是破解本选项的要点,既然要求部署到全局程序集缓存中,那就不可能脱离场管理员的支持了】

选项B. Create the Web Part feature assembly with a strong name and deploy it using a .wsp file to the _app_bin directory of all Web applications where it is needed. Then activate it using delegated administration.
此选项就更直接,我们来看看微软的说明:” Web 部件程序集可以安装在 Web 应用程序的 bin 目录或全局程序集缓存中,如果 bin 目录不存在,您必须手动添加一个 bin 目录。请不要在本地 _app_bin 目录中存储 Web 部件,此目录是专为 Microsoft 保留的。” 所以仅就这一句就可以排除本选项了。

选项C. Create an assembly with a strong name and deploy it to the global assembly cache at the farm level. Activate the feature at the site collection level with delegated administration.
  本选项也与选项A类似,都要涉及到全局程序集缓存,所以也必然被排除了。

因此本题答案应该选 D

参考 
http://msdn.microsoft.com/zh-cn/library/ff798425.aspx
http://msdn.microsoft.com/zh-cn/library/cc768621(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/bb815365(v=office.12).aspx

Question 20
A SharePoint 2010 server farm has a custom feature installed that provides specialized business logic for a SharePoint solution package. The solution package is being updated to include additional functionality. Your job isto specify a deployment method for the updates that will:
.Add the additional application business logic to the solution package.
.Provide the least downtime for the application.
.Automate the application upgrade a much as possible.
You need to update the solution package with additional business logic and meet all these requirements. Which
approach should you recommend?
A. Create a new feature containing the new business logic. Use the feature upgrade process to deploy the solution package by incrementing the version number of the feature in the Feature.xml file.
B. Add the new business logic to the existing feature. Use the feature upgrade process to deploy the solution package by incrementing the version number of the feature in the Feature.xml file.
C. Use Visual Studio 2010 to add the new business logic to the existing code in the .wsp package for the feature. Create two timer jobs - one to retract the current solution package and one to deploy the solution package with
the updated feature.
D. Use the object model to create a custom feature receiver to increment the version property of the SPFeatureDefinition class. Increment the version number of the current solution in the Feature.xml file.

解析:
  本题题意是你的服务器场中已经包含了某个功能,此功能是通过一个方案包部署到场中的。现在,你需要在这个原有的功能中加入更多的操作,然后通过更新升级那个原有的方案包以替换成新的这个具有更多操作的功能。要求是:
  要求1. 新的操作逻辑应该被添加到解决方案包中
  要求2 尽量减少已有方案的停用时间
  要求3. 升级操作尽可以自动化
 我们先来回顾一下Sharepoint关于Feature升级的部分:
在 Microsoft SharePoint Foundation 中,每个功能(Feature)都具有一个在与其对应的 Feature.xml 文件中指定的版本号。在某个特定范围内激活一个功能时,会创建一个与该功能的版本关联的功能实例。利用 SharePoint Foundation 中的功能版本控制,可轻松跟踪功能及其关联实例。之后,当您部署新版本的功能时,SharePoint Foundation 检测到关联的功能也需要进行升级,因为功能实例的版本号小于当前的 Feature.xml 文件中指定的新版本号。
 注释: 最佳做法是,决不将 FEATURES 文件夹中的功能文件与解决方案部署文件或解决方案升级文件分开放置,因为功能升级是一个高级部署选项,它不会在部署期间验证功能 XML。
在运行功能升级时,还会根据新 Feature.xml 文件中指定的升级操作对需要升级的功能实例进行升级。
  接下来分析各备选项:
选项A. Create a new feature containing the new business logic. Use the feature upgrade process to deploy the solution package by incrementing the version number of the feature in the Feature.xml file.
   此选项是重新创建一个新的Feature,这显然不符合在原有Feature的基础上进行升级的要求。而且如上面描述:决不将 FEATURES 文件夹中的功能文件与解决方案部署文件或解决方案升级文件分开放置。另一个层面,你不需要重新定义一个新的Feature来实现升级。所以本选项应该被排除。
选项B. Add the new business logic to the existing feature. Use the feature upgrade process to deploy the solution package by incrementing the version number of the feature in the Feature.xml file.
  在已有的Feature代码中添加新的操作,然后通过Feature升级的相关处理以替换更新原有的Feature。符合上面Feature升级描述。

选项C. Use Visual Studio 2010 to add the new business logic to the existing code in the .wsp package for the feature. Create two timer jobs - one to retract the current solution package and one to deploy the solution package with the updated feature.
本选项试图在VS2010中修改wsp包的代码,向其中添加新的操作逻辑。我们知道,所谓wsp包就是解决方案包, 是一个分发包,可将您的 SharePoint Foundation 2010 自定义开发工作成果分发到服务器场中的 Web 服务器或应用程序服务器。使用解决方案可打包和部署自定义功能、网站定义、模板、布局页、Web 部件、级联样式表和程序集。解决方案包是一个扩展名为 .wsp 的 CAB 文件和一个指令清单文件。可以打包到解决方案中的组件包括:
1 .NET Framework 程序集,通常是 Web 部件程序集和事件接收器程序集。
2.部署文件,例如资源文件、网页或其他帮助程序文件。
3.功能,使您能够激活和停用网站中的代码,并提供包括自定义列表、库、字段和内容类型等元素的功能。
4.新的模板和网站定义。
5.必须在 Web 服务器级别执行的配置,例如,将自定义项部署到 Web.config 文件,以用于注册 Web 部件。您还可以使用随功能分发的功能修改这些配置。
6.被称为网页的 Web 内容(如网页和图像)。如果您必须在断开连接的环境中部署 Web 内容,应该使用内容部署包。
Sharepoint支持创建和部署自定义 Web 部件解决方案包。
本题的目标是,你需要添加新的操作逻辑去升级原有的Feature,因此,本选项的局限在于:1.通过直接修改wsp包的代码是无法添加新的操作逻辑的,因为这些操作逻辑很大程度上是需要被重新编译的,而这样一来,就需要重新生成wsp包,而不仅仅是修改其内部的代码来直接达到。2. 仅添加新的business logic并没有解决如何对Feature进行升级的操作。而至于后续的timer jobs也只是去完成wsp包的卸载与重新安装部署,我们当然可以通过Replacements 方式去升级一个Solution,但这种方式必须要重启我们的IIS,由此会造成downtime时间,这也是本题所不想要的。所以,本选项也应该被排除。
选项D. Use the object model to create a custom feature receiver to increment the version property of the SPFeatureDefinition class. Increment the version number of the current solution in the Feature.xml file.
   本选项没有解决向原有Feature中添加新的操作,只是围绕着如何通过修改版本属性来影响升级,所以也应该被排除。
因此本题答案应该选 B

参考 
http://msdn.microsoft.com/zh-cn/library/ee535723(v=office.14).aspx
http://technet.microsoft.com/zh-cn/library/ff607688(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/aa544500.aspx
http://msdn.microsoft.com/zh-cn/library/ee535708(v=office.14).aspx

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

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

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

  2. Sharepoint学习笔记—ECM系列--文档集(Document Set)的实现

    文档集是 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. JDK和tomcat环境变量配置

    JDK环境变量配置:   如果你的JDK安装在C盘里,如:C:\Program Files\Java\jdk1.6.0_05, 那么就在系统变量里(当然也可以在用户变量里)点新建: 变量名:JAVA_ ...

  2. Windows Azure Cloud Service (36) 在Azure Cloud Service配置SSL证书

    <Windows Azure Platform 系列文章目录> 在某些时候,我们需要在Azure PaaS Cloud Service配置HTTPS连接.本章将介绍如何在本地创建证书,然后 ...

  3. java设计模式学习(-)

    在我目前看来博客的作用就是笔记了,所谓的原创也仅仅是复制了别人的东西实践了一下,但为了学习记忆确实要记录下来.在这里感谢网络各处的资源,原谅我对资源的索取. 接下来每天开始学以则设计模式或者几天学一则 ...

  4. 简单的使用ehcache

    之前一直感觉缓存是高上大的东西,没有心思去研究.做了之后发现,简单的使用还是很容易的.这里记录ehcache在jfinal中的简单使用. 1.ehcahe简介 EhCache 是一个纯Java的进程内 ...

  5. 25套用于 Web UI 设计的免费 PSD 网页元素模板

    Web 元素是任何网站相关项目都需要的,质量和良好设计的元素对于设计师来说就像宝贝一样.如果您正在为您的网站,博客,Web 应用程序或移动应用程序寻找完美设计的网页元素,那么下面这个列表会是你需要的. ...

  6. SQL Server 存储(4/8):理解Page Free Space (PFS) 页

    我们已经讨论了GAM与SGAM页,数据页(Data Page) ,现在我们来看下页面自由空间页(Page Free Space (PFS) ). PFS在数据文件里是第2页(页号1,页号从0开始),接 ...

  7. ElasticSearch 配置详解

    配置文件位于es根目录的config目录下面,有elasticsearch.yml和logging.yml两个配置,主配置文件是elasticsearch.yml,日志配置文件是logging.yml ...

  8. Entity Framework基础01

    学习了ADO.NET的相关知识,掌握了它对数据库表的基本操作,但是实际在开发项目应用中微软为我们开发ef这个ORM,使用它可以很方便的利用ADO.NET来操作DBMS,使得我们开发项目的着重点放在业务 ...

  9. SQL如何增删修改字段

    1: 新增字段: ) NULL EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'土地手续办理情况' , @level ...

  10. Mssql中一些常用数据类型的说明和区别

    Mssql中一些常用数据类型的说明和区别 1.bigint 占用8个字节的存储空间,取值范围在-2^63 (-9,223,372,036,854,775,808) 到 2^63-1 (9,223,37 ...