views:

416

answers:

2

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.

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.

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.

A: 

There may be other ways but the way I do it is with SharePoint Designer. If you open the site you can just drag+drop the ClientAccessPolicy.xml into the root.

Steven Robbins
Yes, that approach matches my search results. However, I was looking for an automatic solution. One can add files to the mapped Layout folder, why isn't there a Root folder (which works)?
Thomas Eyde
It's all down to the voodoo that SharePoint does to virtualise its directories and files. Although you can dump things in the "12 hive" (if it's still called that in 2010) and predict their "virtual" location, I don't think there's any way to "un-virtualise" the root.
Steven Robbins
A: 

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).

ArjanP