The Sharepoint 2010 Blog
Working with Sandboxed Solutions on a Domain Controller
Dec 17th
The sandbox solutions are a great way to develop. But, most of us might be working on a VM, which also happens to be a DC. And one thing about having a SharePoint 2010 server as a DC is that additional steps have to be taken to enable the sandboxed solutions.
Step 1 , is Starting the Microsoft SharePoint Foundation
User Code Service or the SPUserCodev4 from Central admin page.(http://<server:port>/_admin/Server.aspx)

Step 2, actually this step should be done before Step 1, this should become the part of installation process, if you are using a DC as a web front end run the following Power Shell script.
$acl = Get-Acl HKLM:\System\CurrentControlSet\Control\ComputerName
$person = [System.Security.Principal.NTAccount]"Users"
$access = [System.Security.AccessControl.RegistryRights]::FullControl
$inheritance = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit, ObjectInherit"
$propagation = [System.Security.AccessControl.PropagationFlags]::None
$type = [System.Security.AccessControl.AccessControlType]::Allow
$rule = New-Object System.Security.AccessControl.RegistryAccessRule($person, $access, $inheritance, $propagation, $type)
$acl.AddAccessRule($rule)
Set-Acl HKLM:\System\CurrentControlSet\Control\ComputerName $acl
This Script will add an access rule, which will enable the code to be attached to the Sandbox worker process (SPUCworkerprocess), otherwise your VS2010 debugging session will throw up an error complaining about not being able to be attach to the process.
Coding in the Sandbox
Dec 16th
In my Last post we had some introduction to Sandbox solutions in SharePoint 2010.
- Open Visual Studio 2010 and create an empty project, under the SharePoint Node.

-
You will now be prompted to define the solution.The Web site which you want to use for debugging, and the type of solution farm or sandboxed.

Now, from the solution explorer, add a new webpart to your feature, which you must scope to site.

Put some code in the web part, like a label.
protected
override
void CreateChildControls()
{
Label message = new
Label();
Controls.Add(message); Controls.Add(new
WebControl(HtmlTextWriterTag.Br));
message.Text = String.Format("This site contains {0} lists", SPContext.Current.Web.Lists.Count);
}
Build the Code, and hit the debug button. The code will be automatically deployed.
Now add the web part to your page.
And you will see it in action!
Sandboxed Solutions In 2010
Dec 15th
There is a lot of buzz about creating sandboxed solutions in the new 2010 environment. In the previous versions, you could not directly develop on production boxes, without risking the performance/existence of the environment! This innovative way of developing sand boxed solutions gives a lot of scope to develop, at the same time making sure that the developers don’t bring the house down. Now the admins can monitor the developers code, allocate points, and stop code from running if it exceeds limits, on a per site basis. This is done by
- Having a separate process for the Sandbox solutions.
- Exposing a subset of Microsoft.Sharepoint
- CAS policies, Site collection Solution Gallery for deployment and Managing on a per site Basis on Central Admin.
From the Central Admin web site a Farm administrator can limit the point usage of a site for its sand boxed solutions.
A Separate process is used to run these solutions, on the server, not affecting the primary processes of SharePoint.
User Code Service
(SPUCHostService.exe)
Sandbox Worker Process
(SPUCWorkerProcess.exe)
Sandbox Worker Process Proxy
(SPUCWorkerProcessProxy.exe)
A team site Owner can go to his Site galleries page and monitor the usage of his solutions.
http://<servername>/sites/teamsite/_catalogs/solutions/Forms/AllItems.aspx
The artifacts available are
- Content Types, Site Columns
- Custom Actions
- Declarative Workflows
- Event Receivers, Feature Receivers
- InfoPath Forms Services (not admin-appr)
JavaScript, AJAX, jQuery, Silverlight - List Definitions
- Non-visual web parts
- Site Pages
The Objects/methods which are not available are,
- SPSite constructor
- SPSecurity object
- SPUtility.SendEmail method
- SPUtility.GetNTFullNameandEmailFromLogin method
- SPWebPartManager object
- SPWebPartConnection object
- WebPartZone object
- WebPartPage object
- ToolPane object
- ToolPart object

Microsoft Concept of Sandbox Architecture
We will kick the tires, in my next post.
Working with Client Object Model
Dec 9th
The great new feature added to SharePoint 2010 is the Client Object Model. This extends the server side object model to the client. The .Net objects can be used in .net console apps, windows apps or the silver light applications. Another flavor offered is helpful for JavaScript client side coding.
1. Create a new Project (Windows forms) using Visual Studio 2010.

2. Add references to the Client Object Model, from the project references tab, browse to
C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\ISAPI and select the following assemblies, then click OK to add the references to the project:
Microsoft.SharePoint.Client.dll
Microsoft.SharePoint.Client.Runtime.dll

3. Let us add a text box to the form, so that a URL can be supplied by the user.
A Button to submit the URL.
A tab control with 2 tabs, Site and Lists
A tree view control in each tab.

4.Now double click the button to view code and start coding!
private
void buttonGo_Click(object sender, EventArgs e)
{
using (ClientOM.ClientContext ctx = new ClientOM.ClientContext(textBoxURL.Text))
{
ClientOM.Web site = ctx.Web;
ctx.Load(site);
ctx.Load(site.Lists);
ctx.Load(site, x => x.Lists.Where(l => l.Title != null));
ctx.ExecuteQuery();
labelInfo.Text = site.Id.ToString();
foreach (ClientOM.List list in site.Lists)
{
treeViewLists.Nodes.Add(list.Title);
}
ctx.Load(site, x => x.Webs.Where(l => l.Title != null));
ctx.ExecuteQuery();
if (site.Webs.Count != 0)
{
foreach (ClientOM.Web wsite in site.Webs)
{
treeViewSite.Nodes.Add(wsite.Title);
}
}
else
{
treeViewSite.Nodes.Add("No webs found");
}
}
}
}
}
5. Build your Code , and run it.


The Client OM gives a great abstraction layer to work with.
The Artifacts available are
- Site Collections and Webs.
- Lists, List Schema/Items/Views.
- Files and Folders
- Property Bags
- Web parts
- Security
- Content types
- Site templates
- Site Collection Operations
The locations for Client OM resources are
| Server | Microsoft.SharePoint –ISAPI |
| .NET | Microsoft.SharePoint.Client – ISAPI |
| Silverlight | Microsoft.SharePoint.Client.Silverlight -
LAYOUTS\ClientBin |
| JavaScript | SP.js – LAYOUTS |
Creating a New Web application
Nov 24th
It was fairly simple in 2007 to create a new web app, so is it now with the New Ajaxian Interface 2010 has improved over 2007.

Going to application management
http://<servername:port>/_admin/WebApplicationList.aspx
All the web application are listed on this page.
New Ribbon Interface, has all the features, which were once in a list format

Clicking on New will now take you to the popup box, unlike a new page in 2007.

There are a bunch of fields, which need to be filled, in order to get a new web app.
A few new fields have been added.
Authentication

You can now select the type of authentication a specific web app can use.
Fail Over server

You can choose to associate a Failover server.
Search

Services Configuration

You can enable services on demand per web app.
The fields which are used on the form are,
| Field | Old/New |
| Authentication | New |
| IIS Web Site(settings) | Old |
| Security Configuration | Old |
| Public URL | Old |
| Application Pool(Settings) | Old |
| Database Name and Authentication | Old |
| Failover Server | New |
| Search Server | New |
| Service Application Connections | New |
| Customer Experience Improvement Program | New |
After you are done you will receive the following message

That’s it!
Installed 2010 Finally!
Nov 23rd
After a few issues, I was finally able to move on with Installation.

2. After the set up has prepared the necessary files, it prompted me for the product key.

3. After entering the Product Key I noticed the, Software License agreement.

4. After accepting the terms and conditions. I was prompted to choose the type of Installation,
Between Stand Alone and Server Farm. (I will be choosing the server farm. But standalone should be no difficult.)

5. After choosing the server farm, I was prompted to choose between “Complete”, and “Standalone”.
Cool thing I saw here is that there is a tab called “File Location” where you can specify the folders you want the installation to be done in.

I decided to leave the default location as is.

6. After clicking the Install now button, I saw the installation progress screen.

7. After the installation was completed, I was prompted with this screen for running the configuration wizard to complete the deployment.
This completes the Installation of the SharePoint software bits.

Now is the next part configuring the deployment, running the “configuration wizard”

8. Now, clicking on the config wizard. It prompted me with this screen.

9. SharePoint wanted to know where the config Db should be installed, and of course the admin credentials for the db.
Clicking on Next gave me a prompt saying IIS, SharePoint Timer Service, SharePoint Admin Service will be restarted.

10. Similar to 2007, it then prompted me to connect to an existing farm, or create a new one.
Then, I was prompted to enter the DB server, and the admin account credentials.

11. The wizard then kicked me out! I was running an older version of SQL 2008!

12. I then went on to upgrade the SQL server 2008 instance to SP1 cu1.You can get them from Microsoft web site.
After SQL server upgrade, I started my configuration again. This time I was able to successfully create the SharePoint config database.
2010 now offers a new passphrase feature, which is required to be used to add new servers to a farm.

13. After entering the Pass Phrase, I was asked to configure the port on which I wanted to run the Central administration web application.
And also configure security Settings for the central admin web app, for which I planned to use NTLM.

14. After, the security settings, the wizard then prompted me what I was doing, and confirmed if I wanted to move ahead.I noticed the “Advanced” settings tab, this can be used when Sharepoint is configured to create new active directory accounts. Notice a warning
“If you enable this option, you might not be able to upgrade from SharePoint Foundation to other products based on SharePoint Products and Technologies.
If you have trouble installing products based on SharePoint Products and Technologies on this computer, run the SharePoint Products and Technologies Configuration Wizard again to clear this option.”


15. The next screen I saw, mentioned that the configuration was now underway, and it had 10 steps.
It took longer for the step 3, which was creating a config Database.

16. After successful configuration, the screen then showed me the options I saw on step 17 again.

Clicking on Finish completed my configuration.


Now I am ready to roll, with SharePoint 2010 . I then went on to open the central admin site.
After being prompted for credentials, I was prompted with a screen asking me to participate in helping make SharePoint better.
After finishing up with that, I was then led to the page which asked me how I would like to configure my farm!
http://<Servername>/_admin/adminconfigintro.aspx?scenarioid=adminconfig&welcomestringid=farmconfigurationwizard_welcome
At this point I thought, I should take a break and save the rest for a new post!
Update, If you are installing on a Domain Controller and want Sand boxed solutions enabled, then 2 more steps are required.
Installation Issues with 2010
Nov 20th
Installing 2010
- Download the exe file from the internet



The Pre-requisites have to be installed before 2010 gets installed.

Accept the License terms.

Trouble Shoot the errors.





After a handful of trials, we stopped here.
• Windows Server 2008 Service Pack 2: was already installed (no action taken)
• Application Server Role, Web Server (IIS) Role: configured successfully
• Microsoft SQL Server 2008 Native Client: was already installed (no action taken)
• Microsoft .NET Framework 3.5 SP1: was already installed (no action taken)
• Windows PowerShell(TM) V2 (CTP3): installation error
• Microsoft “Geneva” Framework Runtime: Installation skipped
• Microsoft Sync Framework Runtime v1.0 (x64): Installation skipped
• Microsoft Chart Controls for Microsoft .NET Framework 3.5: Installation skipped
• Microsoft Filter Pack 2.0: Installation skipped
• Microsoft SQL Server 2008 Analysis Services ADOMD.NET: Installation skipped





















