The file or folder name contains characters that are not permitted

This is a very misleading error message to get, especially when the cause and solution has NOTHING related to what the message is referring to.

I came across this error while attempting to deploy my site definition. I added a few things to my site definition, one of these was a aspx page referring to my master page.

The error:

<%@ Page language=”C#” MasterPageFile=~masterurl/custom.master” …../>

The fix:

<%@ Page language=”C#” MasterPageFile=”_catalogs/masterpage/custom.master” …../>

Done!

User Code Host Service keeps stopping

I recently came across a this error a few times on different SharePoint 2010 environments. Initially, I came across the error “User Code Host Service is too busy…” , then I stopped and started the User Code Host service from Central Administration. This then caused the error message telling me that the there was “No available Sandbox code execution server  could be found”.

I then looked into the error logs and found some errors about the User Code Host service and Performance logging. I opened the SharePoint log file, and scrolled down to the bottom of the file. Then I did a CTRL+F for “Perf”. I then found the error relating to starting the code host service and how the service has stopped.

 

And NO, STOPPING AND STARTING THE BLOODY USER CODE HOST SERVICE IN CENTRAL ADMINISTRATION DOES NOT FIX THIS PROBLEM!

 

Resolution:

I came across these this fix that resolved the issue of the User Code Host Service keeps stopping:

         http://support.microsoft.com/kb/2021539

 

This KB Article below was already done, but might be helpful for you too.

http://support.microsoft.com/kb/2509267

Done.

Operation is not valid due to the current state of the object.

I came across this error today while attempting to update my WSP via Sharepoint Powershell console.

I have been working on creating calculated fields in xml and the requirement was to include the <= (less than or equal to) symbol in the schema. Because this didn’t work, I changed this symbol to &leq. When I atttempted to update the solution, this is the error I got in the powershell window

Operation is not valid due to the current state of the object.

I removed &leq; from the fields xml and list xml schemas and this fix the problem, but not the requirement.

 

But if you are ever working with fields, content types, or lists schemas and you come across this problem, the likely issue would be invalid symbols or syntax in the xml.

JavaScript Index Of

<html>

<body>

<input id=”hdnList” type=”hidden” value=”http://website1.com,http://website2.com,http://website3.com.au&#8221; />

</body>

<script type=”text/javascript”>

var urlArray = new Array();
var str = document.getElementById(“hdnList”);

urlArray = str.value.split(‘,’);

var strResult = “http://website2.com/search/subsite&#8221;;

var i = 0;

for(i = 0; i < urlArray.length; i++)
{

if(urlArray[i].indexOf(strResult) != -1 || strResult.indexOf(urlArray[i]) != -1)
{
alert(urlArray[i]);
}

}

</script>

</html>

Customise spell checker dictionary in SharePoint 2010

To add words to the dictionary spell checker, use these instructions :

http://manish-sharepoint.blogspot.com/2010/05/adding-custom-spellings-in-sharepoint.html

 

If the changes do not take effect, following these steps,

http://blogs.msdn.com/b/vijgang/archive/2009/07/23/changes-to-the-custom-dictionary-txt-file-are-not-taking-effect.aspx

 

Nexus S ICS update mobile internet and wireless not working

Yup, I was one of the impatient Nexus S owners who did not want to wait and decided to do the manual ICS update by downloading the ICS update via Andriod Police website and installing it.

And yes, Mobile Internet and Wireless internet was not working straight after I did the update.

BUT

I got it working 🙂 and it was easy !

Enable Mobile Internet

1.  Open the Dialler (click on the icon on the left hand bottom that looks like a phone)

2. Type *#*#4636#*#* into your phone

3. The Testing menu will open

4. Select Phone information -> select Run ping test and you should get an IO.Exception error

5. Scroll down the page and select Turn off Radio

6. The text on the button should turn to Turn on Radio. After this happens, select Turn on Radio

7. Scroll up the page and select Run ping test

8.  The following tests should result in a Pass: PingIpAddr, Ping Host Name (www.google.co.uk), and Http Client Test

9. Ensure Data enabled is ticked and the correct Access Point Names is selected under Mobile network settings

10. Open up a Internet Browser on your phone and navigate to a web site

11. Done!!!! 🙂 Merry Christmas !!!!!!!!!!!!!!!!!!!!!!!

 

Test Wireless

1.  Open the Dialler (click on the icon on the left hand bottom that looks like a phone)

2. Type *#*#4636#*#* into your phone

3. The Testing menu will open

4. Select Wi-Fi information

5. Select Wi-Fi status

6. Run ping test.

7. The following tests should now all Pass: Ping IpAddr, Ping Host Name (www.google.co.uk), HTTP Client test

8. Now exit the menu and turn on Wireless if you have not already and connect to the internet!

 

 

 

Using session state in HttpModule – SharePoint 2010

I recently created a HTTPModule for a SharePoint 2010 web application and I planned to store some values in session variables.

In my httpmodule, I am using the context_PreRequestHandlerExecute as an entry point :

void context_PreRequestHandlerExecute(object sender, EventArgs e)
{
          HttpContext ctx = ((HttpApplication)sender).Context        

          ctx.Session.Add(“Phil Lau”, “SharePoint”);
           …
}

I was expected to be able to use the Session state from the get-go, but no, it returned an null exception when attempting to use the Session state to store a value. In the Visual Studio Immediate window, ctx.Session returns null. This prevented me from storing values into the session state.

The solution 🙂 (Yes, you have to enable session state in SharePoint 2010 web applications)

 

Two things I had to do:

1) Enable Session State for the web application

a)  Open up the web.config for your web application, do a CTRL+F for sessionstate

b) When you find <pages enableSessionState=”false” enableViewState=”true” … change enableSessionState to
“true”

c)  Save web.config

2) Add the Session http module into my web.config

a) In same web.config as above, go to the httpmodules section. This section looks like this <modules runAllManagedModulesForAllRequests=”true”> <remove name=”AnonymousIdentification”/> …….

b) Locate <remove name=”Session” /> and delete it

c) Save web.config and refresh your web site

 In the Visual Studio Immediate window, ctx.Session returns null. This prevented me from storing values into the session state.

 

Done! This worked for me, I was able to access and use the session state!