I have ported a SP site from a dev server to a live server, as may be seen in other questions, and have another problem.

I have 1 page which uses some server side code to run. On dev it works, on live I get the error:

Code blocks are not allowed in this file.

Now from previous experience with this I know that it has to do with the PageParserPaths which is the same on the dev and live server. I have used the line:

<PageParserPath VirtualPath="/TestSite/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true"/>

Now the problem, I believe, is down to the fact that the web.config and the Sharepoint TestSite are on different ports. I.e. The Central Admin is located at http://server:29110/default.aspx and the TestSite is located at http://server/TestSite/default.aspx. So the web.config file is located in VirtualDirectories/21190

I may be getting completely confused about the different web.config files and this whole situation but I just need advice on where to look from here.

1 Answer 1


Please change your web.config file from:

<PageParserPath VirtualPath="/TestSite/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true"/>

to this:

<PageParserPath VirtualPath="~/TestSite/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true"/>

hope this help u..:)

  • What web.config file should I be changing?! If I change the one in the 21190 directory, nothing changes, if I add it to the one in the 80 directory I get the message, "An unexpected error has occurred." Nov 23, 2011 at 14:20
  • Ok, adding them to the web.config in the 80 directory was the solution. The unexpected error was that I didn't have the correct ODBC driver installed. Now I've another problem but that's for another question! Nov 24, 2011 at 10:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.