I’m posting this here as, despite using this all the time, I still find myself looking it up.
There are a couple of things you can do, in your Dev environment, to assist with debugging SharePoint and your custom solutions.
CustomErrors and SafeMode
This should only be used in a Dev environment, but you can disable the “friendly” error messages in SharePoint and replace them with full exceptions, and, if desirable, a stack trace.
You can edit the web.config for your application. Note: SharePoint has various web.configs spewed about the place, and for this to work, you need to edit the one located in
Read more
Using SharePoint Workflow (in fact, Nintex, but it applies to “standard” SharePoint workflow, after all, Nintex is just standard workflow with a few bells and whistles) on a document library and a workflow that is set to auto-start on document creation.
The symptoms were: if you add a document to the library, then the workflow fires, but it sits forever in a state of “starting”. However, if you manually start the workflow on the same document, then it runs absolutely fine.
Read more
If you try to deploy an SSRS report from Visual Studio to your SharePoint environment, where SSRS has been configured in Integrated Mode, using the built-in deployment mechanism, you may encounter a situation where you are endlessly prompted for login boxes, and no account details seem to help.
There is some useful info out there about what causes this - typically a mismatch where you’re using Kerberos authentication. There’s a good post and some resolution here.
Read more
When SharePoint goes bad: spurious error messages in the ULS logs that will lead you down a blind path. ULS logs were full of User Profile related errors, all saying moreorless this:
Exception occured while connecting to WCF endpoint: System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. —> System.ServiceModel.FaultException: An error occurred when verifying security for the message
Spent a while looking through the UPS app config, Profile DB and everything looked normal. The issue is actually a “generic” WCF error - whereby the system clocks on the App Server (1) and WFE server (2) were out of sync by about 6 minutes. Manually setting the clock on the slow one to the current time resolved the issue.
Read more
I’ve been doing some work with dynamically populating a Managed Metadata term store using the API and data stored in a list.
The code was quite simple - check to see if a term existed, and if not, add it. The first pass of this routine would work fine, but then the second pass would crap out with an issue:
There is already a term with the same default label and parent term.
After a bit of debugging, I figured out it was falling over on a term that contained an & (ampersand) in the name. After a further bit of debugging (converting the character to HEX) it became apparent that it’s storing it as the wide (*pretty) rendition of the ampersand. And after some further research, it would appear that this is by design!
Read more
Tripped over this issue today. This post explains exactly what’s going on - namely that when using the OfficialFile web service (for e.g., records management), the 50mb upload file size is in place, irrespective of any setting the Web Application General Settings.
Fix:
- Make sure that you have set the max file size on the web application
Central Admin –> Manage Web Applications –> Select the Web Application –> General Settings –> Maximum Upload Size- Open the following file and edit on each SharePoint server:
C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14ISAPIweb.config
Add the following section, then save and close
<system.web> </system.web>
Didn’t even need to recycle the web services website/app pool. Perfect!
Read more
A while ago, I posted about an issue with deploying a custom SharePoint retention policy where activating a feature was failing due to a permissions issue.
I fell over this issue again recently, but despite following all the advice in that post, I still couldn’t get things to activate and I didn’t really want to start giving all known service accounts local admin and DBO on everything in sight. So instead, I used a quick Powershell workaround. This works because PS always runs in the context of the Farm Admin, so I assumed it must have the relevant permissions. This script will find the feature you want to activate, and then activate it. Success is no message returned!
Read more
I’m noting this here primarily because I’m almost certain to trip over this again in the future. If you want to use the ACE or JET providers to read an e.g., Excel spreadsheet to an e.g., SQL Server table, then something like this is possible. Assuming you had a simple Excel workbook (Book1.xlsx) and in Sheet1 you had
Col1 Col2
Test Test2
You could use this to load it:
SELECT * INTO #tmpTable FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0 Xml;HDR=YES;Database=C:TempBook1.xlsx','SELECT * FROM [Sheet1$]')<br /> GO<br /> SELECT * from #tmpTable<br />
One approach to monitoring version history of items in SQL tables is to use an _Audit table version with database triggers. However, the creation and maintenance of the tables and triggers can be time consuming. This post provided a nice script to automate the creation but unfortunately it suffered a few issues. In the comments, someone posted a sproc version of the script - but unfortunately this was also broken.
So I have tidied it up and fixed the issues. My host doesn’t let me post SQL in these posts, so you can view the file here.
Read more
This is one of those SharePoint errors. You know the ones.
Background
I was trying to use SharePoint Designer to customise a list. I opened up SharePoint Designer, and, although I could connect to the site itself, when clicking on the lists/libraries folder, you get a message saying:
“There are no items to show in this view”.
Weird. I tried this on various other web applications (even on the same server) and everything was working fine.
Read more