I often get a number of questions from developers who want to know how to apply their own customizations to the application pages that ship as a part of Windows SharePoint Services 3.0 and Office SharePoint Server 2007. Well, apparently, I'm not alone as we've just recently released a KB article that describes the process and addresses many frequently asked questions on how to perform these customizations in a manner that is supported by Microsoft.
Excerpt taken from the article:
Modifying the files that are installed by SharePoint is not supported. However, there are some scenarios in which you may have to modify these files to achieve consistent branding or other customizations. When you modify these files, you must consider that they may be replaced by future updates and service packs. Additionally, there may be complications when you upgrade to later versions of the product. Keep backup copies of all customized files in case they are overwritten by an update. Product support will provide commercially reasonable support for help with modifications but will be unable to provide product changes or hotfixes that result from modifying the files that are installed by SharePoint.
More details can be found at http://support.microsoft.com/kb/944105/en-us.
I'd been racking my brain trying to remember the configuration steps for configuring a Virtual PC -based VM that's running as a Domain Controller (with DNS enabled) to access the internet. I've done this many times in the past and just couldn't remember the steps. This is a tricky thing because with a DC, DNS is also installed, therefore if you run your VM on say…your corporate network, and you have DNS enabled, then the DNS server within your VM could potentially be handing out IPs to DHCP-enabled networked clients. This doesn't make your IT department (most notably, your Network Administrators) happy
because whenever you shut down the VM, everyone who had an IP issued by your DNS server can't resolve and thus looses network connectivity
I can't count how many times I've seen folks give demos and wound up hosing almost every one of their colleagues in their office because they just hard-wired into the corporae network with VMs running as DCs with DNS enabled
I stumbled across this post, from the UK Dynamics CRM Blog, that provides a nice summary of the steps. Hopefully this will be a good reference in case you get into some configuration scenarios where you need to do this. For those of you doing development or giving demos using a Virtual PC, hopefully this will save you (and your Network Admins) a lot of pain ![]()
I was recently presented a scenario by a gentleman who wanted more control over a MOSS 2007 site, list, and item settings. He wanted to essentially “track” changes that were made to these artifacts within a given site collection. In addition, he wanted to know the type of change that occured.
SPListEventReceiver or SPWebEventReceiver you might suggest? Not quite the solution here. One of the “hidden gems” within the SharePoint object model is the SPChange class. This class represents a change that has been made to objects or metadata within an item, list, Web site, or site collection scope, or a security policy change at the Web application scope that has been recorded in the Microsoft Windows SharePoint Services change log. An example of this functionality is cited in the code example below:
SPSite siteCollection = SPContext.Current.Site;SPWeb site = siteCollection.AllWebs["Site"];
SPListCollection lists = site.Lists;
SPRegionalSettings regionSettings = site.RegionalSettings;
SPTimeZone timeZone = regionSettings.TimeZone;
SPChangeQuery query = new SPChangeQuery(true, true);
SPChangeCollection changes = site.GetChanges(query);
foreach (SPChange changedObject in changes)
{
switch (changedObject.GetType().ToString())
{
case "Microsoft.SharePoint.SPChangeItem":
SPChangeItem changedItem = (SPChangeItem)changedObject;
try
{
Response.Write(lists[changedItem.ListId].Title + " == " + lists[changedItem.ListId].GetItemByUniqueId(changedItem.UniqueId).Name + " == "
+ timeZone.UTCToLocalTime(changedItem.Time) + " == " + changedItem.ChangeType + "
");
}
catch
{
Response.Write("The object to which item " + changedItem.UniqueId + " belongs does not exist.
");
}
break;
}
}
The code snippet above allows you to display the names of lists in which items in a site has changed. The SPChange object provides a powerful mechanism for retrieving this type of information in MOSS. Note the use of the GetChanges() method that is being called on the SPSite object in the code above. The GetChanges() method of the SPList, SPWeb, SPSite, or SPContentDatabase object returns the collection of changes that have occurred within the given scope.
In addition to SPChange, there are quite a few other classes that have similar functionality and represent various types of changes that occur during the lifecycle of a SharePoint site, list or item. I’ve cited a few of them below:
SPChangeGroup
Represents a change to a group
http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spchangegroup.aspx
SPChangeSecurityPolicy
Represents a change to a security policy
http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spchangegroup.aspx
SPChangeUser
Represents a change to a user
http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spchangegroup.aspx
Found an interesting post on Chris Sells' blog that talks about how to grant FullTrust to mapped network drives.
The following is taken from his great post:
When attempting to load a VS.NET project from a Network Drive (like Z:) you may receive the following error
The project location is not trused.
Running the application may result in security exceptions when it attemps to perform actions which require full trust
What's happening is that VS is detecting that the project on the network drive is getting Intranet permissions according to the good and true workings of .NET Code Access Security (CAS). However, since I'm just trying to pretend that Z is on my PC (and, in fact, it is), I want it to have FullTrust permissions.
To accomplish this, you need to add a new Code Group with an URL membership permission specifying the folder (in URL form) to which you'd like to grant full trust. You can do with the .NET Framework Configuration tool or you can do it from the command line like so:
c:\>caspol -q -machine -addgroup 1 -url file:///z:/* FullTrust -name "Z Drive"
Once this new code group is in place, any new .NET processes you start will give any assemblies on the Z drive full trust.
Since awarding new permissions, full trust or not, to any chunk of code is something that can cause a security hole, be careful.
Thanks Chris for the tip! This will prove to be invaluable as I use Virtual PC, and reference projects on my host PC from within a VPC session through folder mappings.
I've been asked a number of times about installation order of SharePoint Portal Server 2003 and Exchange 2003 on a domain controller. “Why on earth would a person want to do that?”, you ask? Well, both SharePoint and Exchange development introduce some rather tricky development scenarios, and rather than butt heads with your local network admin, folks lean to developing within a “sandboxed” environment, like that provided by a virtual machine running in either VMware or Virtual PC , where they could potentially be “mobile“ and not be joined at the hip to servers or their friendly neighborhood admin.
So, with that being said, in order to have both products coexist on the single machine, Exchange must be installed first, then SharePoint Portal Server. The full installation order I typically use is as follows (for simplicity, let's say we're creating a dev environment in a Virtual PC virtual machine):
Done. These are some basic steps that I follow (with a few more additions not listed). Some folks may have different approaches, but this has yielded a 100% success rate for any initial install I've done on my local development machine VMs