Archive for SharePoint

Running the SharePoint 2010 IW Demo VM under Windows 8

Here is something that is very cool.  Windows 8 includes Hyper-V, and it is super painless to run the SharePoint 2010 IW Demo VM under Windows 8:

Further, I was able to connect the wireless adapter to the VM, and activate Windows Server 2008 using WIFI. When using this VM under WS2008, it was necessary to physically connect a wire to the computer to do this activation, since there was no way to connect a WIFI adapter so that a VM could connect to the internet.

And, even while the VM is running you can sleep the computer!!!!  How awesome is that! This capability alone makes Windows 8 worth the price of admission.

In a nutshell, here are the steps:

  • Make sure that you have enabled hardware virtualization in your BIOS.
  • Go to Control Panel, then go to Programs and Features
  • Click ‘Turn Windows features on or off’
  • Check the Hyper-V node in the tree control, let it install, and then reboot.
  • Download and unpack the SharePoint 2010 IW Demo VM in the usual way. The remainder of these steps are basically identical to how you setup this VM when using Hyper-V under Windows Server 2008 R2 (with the minor exception that you can use WIFI to activate WS2008 in the VM).
  • Using the Virtual Switch Manager in the Hyper-V Manager, add an internal network adapter (as detailed in Virtual Machine Setup Guide.docx). This guide is available on the same page as the rest of the IW Demo VM. This network should be called ‘Internal’. Set the IP4 address, per the instructions in the Virtual Machine Setup Guide.
  • Import the Virtual Machine.
  • Configure the memory and/or processors as necessary or desired.
  • Boot the VM, and let it stabilize.  It will add drivers and need to reboot. After rebooting, and letting the machine do all of its JITting, you can start IE and see SharePoint 2010 running.
  • Shut down the VM.
  • Using the Virtual Switch Manager in the Hyper-V Manager, add the WIFI network adapter.
  • Edit the settings for the 2010-10a VM, and add the WIFI adapter to the Virtual Machine.
  • Boot the machine. If you have WIFI connectivity, you will be able to browse the web from inside the VM.
  • Click Start -> Right-Click Computer -> Properties. You can activate the VM from this dialog box. You now can use this VM without interruption for 180 days.
  • Shut down the VM. Remove the WIFI adapter from the settings for the VM.
  • Reboot, enjoy

Comments (6)

Getting Started with the SharePoint Demo Hyper-V Virtual Machine

The 2010 Information Worker Demonstration and Evaluation Virtual Machine, (also known, at least by me, as the SharePoint 2010 Evaluation VM) is my favorite way to play around with SharePoint development. If you have a computer running Windows Server 2008 R2, you can get up and going quickly with the VM. The VM has everything you need in it to get going with SharePoint development – an operational installation of SharePoint Server 2010, Office 2010, Visual Studio 2010, SharePoint Designer 2010, SQL Server 2008 R2, Silverlight, and much more. This means that you can be writing code within minutes of installation of the VM. After downloading the VM, it takes less than half an hour to get up and going. In this post, I introduce a two-part video that walks through the process of getting the SharePoint Eval VM up and running.

Download: 2010 Information Worker Demonstration and Evaluation Virtual Machine

The Windows Server 2008 and Windows Server 2008 R2 instances used in these virtual machines are distributed without activation or a valid product key. You will receive activation notifications a few days after your first use, and expiration notifications after 120 days.

The Virtual Machines contained in this package are un-activated 180 day evaluations. They will require activation, or re-arming, after a 10 day period after which they will shut down after 2 hours of continuous operation. You can reset the activation clock a limited number of times (4 or less is what the setup guide indicates). Some time ago, I wrote a blog post, How to Install and Activate the IW Demo/Evaluation Hyper-V Machine, which walks through the process of connecting the VM to the internet and activating it, after which the VM will operate properly for 180 days.

I am going to be posting a few screen-casts in the near future about SharePoint, BCS, and some other fun topics. To make it as easy as possible for you to follow along in those screen-casts, I’ve recorded a 2-part screen-cast that walks through the process of getting the SharePoint Demo VM up and going. Those other screen-casts will take up where these screen-casts leave off.

Here is the first of the two parts:

First of two-part series that walks through the process of getting the SharePoint Developer Demo VM up and going.

Here is the second of the two parts:

First of two-part series that walks through the process of getting the SharePoint Developer Demo VM up and going.

In the next screen-cast, I’ll show you how to install the AdventureWorks demo database, and create an external content type (ECT) using a table in that database.

Comments (8)

Consuming External OData Feeds with SharePoint BCS

I wrote an MSDN Magazine article, Consuming External OData Feeds with SharePoint BCS, which was published in April, 2011.  Using BCS, you can connect up to SQL databases and web services without writing any code, but if you have more exotic data sources, you can write C# code that can grab the data from anywhere you can get it.  Knowing how to write an assembly connector is an important skill for pro developers who need to work with BCS.  This article shows how to write a .NET Assembly Connector for BCS.  It uses as its data source an OData feed.  Of course, as you probably know, SharePoint 2010 out-of-the-box exposes lists as OData feeds.  The MSDN article does a neat trick – you write a .NET assembly connector that consumes an OData feed for a list that is on the same site.  While this, by itself, is not very useful, it means that it is super easy to walk through the process of writing a .NET assembly connector.

I write the article and the code for the 2010 Information Worker Demonstration and Evaluation Virtual Machine (RTM).  Some time ago, I wrote a blog post, How to Install and Activate the IW Demo/Evaluation Hyper-V Machine.

The MSDN article contains detailed instructions on how to create a read-only external content type that consumes an OData feed.  This is an interesting exercise, but advanced developers will want to create .NET assembly connectors that can create/read/update/delete records.  The procedures for doing all of that were too long for the MSDN magazine article, so of necessity, the article is limited to creating a read-only ECT.

However, I have recorded a screen-cast that walks through the entire process of creating a CRUD capable ECT.  It is 25 minutes long, so some day when you feel patient, you can follow along step-by-step-by-step, creating a CRUD capable ECT that consumes an OData feed.  Here is the video:

Walks through the process of creating an ,NET connector for an ECT that consumes an OData feed.



The procedure requires code for two source code modules: Customer.cs, and CustomerService.cs.

Here is the code for Customer.cs:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Contoso.Crm
{
    public partial class Customer
    {
        public string CustomerID { get; set; }
        public string CustomerName { get; set; }
        public int Age { get; set; }
    }
}

Here is the code for CustomerService.cs:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;

namespace Contoso.Crm
{
    public class CustomerService
    {
        public static Customer ReadCustomer(string customerID)
        {
            TeamSiteDataContext dc =
                new TeamSiteDataContext(
                    new Uri("http://intranet.contoso.com/_vti_bin/listdata.svc"));
            dc.Credentials = CredentialCache.DefaultNetworkCredentials;
            var customers =
                from c in dc.Customers
                where c.CustomerID == customerID
                select new Customer()
                {
                    CustomerID = c.CustomerID,
                    CustomerName = c.CustomerName,
                    Age = (int)c.Age,
                };
            return customers.FirstOrDefault();
        }

        public static IEnumerable<Customer> ReadCustomerList()
        {
            TeamSiteDataContext dc =
                new TeamSiteDataContext(
                    new Uri("http://intranet.contoso.com/_vti_bin/listdata.svc"));
            dc.Credentials = CredentialCache.DefaultNetworkCredentials;
            var customers =
                from c in dc.Customers
                select new Customer()
                {
                    CustomerID = c.CustomerID,
                    CustomerName = c.CustomerName,
                    Age = (int)c.Age,
                };
            return customers;
        }

        public static void UpdateCustomer(Customer customer)
        {
            TeamSiteDataContext dc =
                new TeamSiteDataContext(
                    new Uri("http://intranet.contoso.com/_vti_bin/listdata.svc"));
            dc.Credentials = CredentialCache.DefaultNetworkCredentials;
            var query =
                from c in dc.Customers
                where c.CustomerID == customer.CustomerID
                select new Customer()
                {
                    CustomerID = c.CustomerID,
                    CustomerName = c.CustomerName,
                    Age = (int)c.Age,
                };
            var customerToUpdate = query.FirstOrDefault();
            customerToUpdate.CustomerName = customer.CustomerName;
            customerToUpdate.Age = customer.Age;
            dc.UpdateObject(customerToUpdate);
            dc.SaveChanges();
        }

        public static void DeleteCustomer(string customerID)
        {
            TeamSiteDataContext dc =
                new TeamSiteDataContext(
                    new Uri("http://intranet.contoso.com/_vti_bin/listdata.svc"));
            dc.Credentials = CredentialCache.DefaultNetworkCredentials;
            var query =
                from c in dc.Customers
                where c.CustomerID == customerID
                select new Customer()
                {
                    CustomerID = c.CustomerID,
                    CustomerName = c.CustomerName,
                    Age = (int)c.Age,
                };
            var customerToDelete = query.FirstOrDefault();
            dc.DeleteObject(customerToDelete);
            dc.SaveChanges();

        }

        public static void CreateCustomer(Customer customer,
            out Customer returnedCustomer)
        {
            // create item
            TeamSiteDataContext dc =
                new TeamSiteDataContext(
                    new Uri("http://intranet.contoso.com/_vti_bin/listdata.svc"));
            dc.Credentials = CredentialCache.DefaultNetworkCredentials;
            CustomersItem newCustomer = new CustomersItem();
            newCustomer.CustomerID = customer.CustomerID;
            newCustomer.CustomerName = customer.CustomerName;
            newCustomer.Age = customer.Age;
            dc.AddToCustomers(newCustomer);
            dc.SaveChanges();
            returnedCustomer = customer;
        }
    }
}

Comments (6)

Welcome – First Post

As I mentioned on my MSDN blog, January 21, 2011 will be my last day as a Microsoft employee. I am shutting down the MSDN blog, and am commencing to blog here at ericwhite.com/blog. If you liked my previous blog, I expect that you will like this one. Here are my first projects:

Open XML Document Generation

I also want to write a number of samples around parameterized document generation. While it is fairly straightforward to build applications that can generate documents, I think that there is much more that can be done to make document generation much simpler and more powerful. This should be possible generate a wide variety of documents from a wide variety of data sources by changing a source template document that contains content controls. There are existing MSDN articles that show how to generate a lot of documents, but I think I’ll have my own special take on this problem.

Open XML SpreadsheetML Formulas

I’m going to complete the blog post series on writing a recursive descent parser for SpreadsheetML formulas using C# and LINQ.

SharePoint

I want to teach myself the nooks and crannies of the SharePoint server object model. In that process, I’m going to write a fair number of snippets that demonstrate how to work with particular parts of the API. I’ll be blogging those snippets. In addition, I’ve wanted to write about a number of areas of SharePoint.

I’m not sure where else my interests will take me, but one thing is certain – I’m going to continue to focus on Open XML. There is much more that can be done with functional programming and Open XML. And I think it is possible to build some amazing applications using Open XML in a SharePoint application. In blog posts on my MSDN blog, I’ve worked out the mechanics of working with Open XML documents in SharePoint, however, I haven’t really started taking advantage of file formats to ‘light up’ documents.

This is going to be fun!

Eric White, software developer

Comments (12)