FIX: 'XSLT compile error' on host-named site collection

Scenario:
On your host-named site collection you are trying to reference an XSLT file hosted in a SharePoint Library.
Assuming you have already checked that the xslt file is where it is expected to be.

Your code could look like this:

XmlUrlResolver resolver = new XmlUrlResolver();
resolver.Credentials = CredentialCache.DefaultCredentials;

XmlTextReader stylesheet = new XmlTextReader(xslLink);
stylesheet.XmlResolver = resolver;

XslCompiledTransform transform = new XslCompiledTransform();
transform.Load(stylesheet);

On the last line you are getting this error:
XSLT compile error.
   at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)
   at System.Xml.Xsl.Xslt.XsltLoader.Load(Compiler compiler, Object stylesheet, XmlResolver xmlResolver)
   at System.Xml.Xsl.Xslt.Compiler.Compile(Object stylesheet, XmlResolver xmlResolver, QilExpression& qil)
   at System.Xml.Xsl.XslCompiledTransform.CompileXsltToQil(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
   at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
   at System.Xml.Xsl.XslCompiledTransform.Load(XmlReader stylesheet)

Fix:
On the SharePoint server, add the host-name and IP in the "hosts" file (%systemroot%\system32\drivers\etc\hosts). Your new entry should look like:
10.10.10.190 SharePointTest.microsoft.com 
10.10.10.190 is the server's public IP address
SharePointTest.microsoft.com is your site collection host-name

Cause:
SharePoint is trying to access the XSLT file using a URL like:
http://SharePointTest.microsoft.com/Styles/MyStyleFile.XSLT
and it cannot reach the named address http://SharePointTest.microsoft.com

Note: The change will not take effect immediately. You can wait a few minutes or try this command:
ipconfig /flushdns

Add custom DLL to deployment package

Scenario:
You have a custom (helper) DLL that you need to include in your deployment. As this is not a SharePoint solution you cannot deploy the same way you would to with a webpart for example.

Solution:
In Visual Studio, open your solution package:

Select the Advanced tab:

Add your DLL in the dialog:

Tooltip style notification

Scenario:
You want to show a brief status message to the user. The notification will slide in and the out to the right side of the window.


Java Script:
SP.UI.Notify.addNotification('<img src="/_layouts/images/loadingcirclests16.gif" style="vertical-align: top;"/>Loading ...', false);

If you want your notification to stay on the screen until the process finishes you can use a couple of functions like:

function AddNotification() {
  notifyId = SP.UI.Notify.addNotification("Loading ...", true);
}

function RemoveNotification() {
  SP.UI.Notify.removeNotification(notifyId);
  notifyId  = '';
}
Notes:
The second parameter (set to true above) sets the stickiness of the note.
The notifyId variable, set when creating the notification, is used again when hiding it.

More about it on MSDN:
http://msdn.microsoft.com/en-us/library/ee658473(v=office.14).aspx

FIX: Duplicate field in list view form

Scenario:
One or more list fields appear twice on the forms associated to a list (new, edit and view). There are no duplication in the list columns. The list is using a custom content type.

For example the Answer field shows twice on the New FAQ form:


Things to look for:
Check that the field/column is not declared twice in the list settings page.

Cause:
I have seen this happening in 2 cases:
1. when changing and re-deploying the underlying content type
2. when migrating lists from one site to the other (using PowerShell in my case)

Fix:
Browse to the list settings page (on the List Tools - List ribbon click on the List Settings icon)

In the Content Types section click on the content type link

Remove the duplicated column

FIX: PowerShell Remoting fails

Scenario:
Your attempt to remote using PowerShell fails with this message:
Cannot access the local farm. Verify that the local farm is properly configured, currently available, and that you have the appropriate permissions to access the database before trying again.

Fix:
1. On the remote machine run the following PowerShell script:

#Enable Windows PowerShell Remoting 
Enable-PSRemoting -Force 
#Enable CredSSP support 
Enable-WSManCredSSP -Role Server -Force 
#Increase memory limit for remote shell 
Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1000

2. On the client machine run the following PowerShell script:
#enable CredSSP on the client:  
Enable-WSManCredSSP -Role Client -DelegateComputer * -Force   
Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowFreshCredentials -Name WSMan -Value WSMAN/*   
Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowFreshCredentialsDomain -Name WSMan -Value WSMAN/*

Props:
Josh Gavant: PowerShell Remoting for SharePoint