如何将 ClientAccessPolicy.xml 文件添加到 SharePoint 2010 根文件夹? [英] How can I add a ClientAccessPolicy.xml file to the SharePoint 2010 root folder?

查看:59
本文介绍了如何将 ClientAccessPolicy.xml 文件添加到 SharePoint 2010 根文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Visual Studio 2010 SharePoint (2010) 项目中,我们可以添加映射的 SharePoint 文件夹,包括 {SharePointRoot} 文件夹.当我部署我的项目时,我可以看到根文件最终出现在 14-hive 中,但它们从未出现在网站根目录中.

In a Visual Studio 2010 SharePoint (2010) project, we can add mapped SharePoint folders, including the {SharePointRoot} folder. When I deploy my project, I can see that the root files end up in the 14-hive, but they never appear in the web site root.

我真正想要完成的工作是对与 SharePoint 站点通信的 Silverlight 应用程序进行单元测试.我尝试了许多关于该主题的变体,从添加 MS 单元测试到公共类库项目、测试项目,最后是 Silverlight 测试项目.

What I really want to accomplish to unit test my Silverlight application which communicates with a SharePoint site. I have tried many variations on the subject, from adding MS unit tests to common class library project, test projects, and finally a Silverlight test project.

当我运行我的 Silverlight 测试项目时,由于缺少 ClientAccessPolicy.xml,所有访问 SharePoint 站点的测试都失败了.我真的不想在 SharePoint 网站中使用此文件,因为我们不想授予对外部 Silverlight 应用程序的访问权限.

When I run my Silverlight test project, all tests that access the SharePoint site fails due to a missing ClientAccessPolicy.xml. I really don't want this file in the SharePoint site, as we don't want to grant access to outside Silverlight apps.

推荐答案

您可以创建一个功能来在您的 Web 中配置文件.请参阅如何配置文件.

You can create a Feature to provision files in your web. See how to provision a file.

然后,您可以将此功能装订到您的站点定义中或手动激活它(例如,在您的部署脚本中添加脚本).

You can then staple this feature to your site definition or activate it manually (e.g. script in in your deployment scripts).

这篇关于如何将 ClientAccessPolicy.xml 文件添加到 SharePoint 2010 根文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆