I have a problem in visual studio SharePoint projects deployment that when an error occurred there is no stack trace enabled that i can see the details of the error like that
So i found a solution to enable stack trace for SharePoint projects in visual studio by adding a registry key to enable diagnostics logging for SharePoint projects
- Open registry editor by open start up menu – > type run -> type regedit then click ok
- Create a DWORD key type , the name is “EnableDiagnostics” and value “00000001” under HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\SharePointTools “the “10.0” folder for visual studio 2010 and you can do the same in your visual studio version“
- Restart the operating system
- Now i can see the details of deployment in the visual studio output window as image below and in which step it fails.
Hope it will help.
Sometimes when you try to deploy your SharePoint solution from visual studio an error occurred
visual studio wsp deployment Error occurred in deployment step ‘Add Solution': Value cannot be null
The error comes because you opened “Elements.xml” in visual studio IDE when you deploy the solution ! it fails when the “FindConflicts()” method invoked during add solution step in visual studio deployment.
Two solutions to solve that :
- Simply close any “Elements.xml” file opened in visual studio IDE then deploy it will success :D
- Change deployment conflict resolution for your module from Automatic “the default value” to None – image below
That’s it ! :)
The Problem / Example : Need to put the “alt” attribute in the HTML “img” element from a content type field “Title” in a custom page layout and the content type fields represented as a SharePoint controls like that
You can do that simply by CSS/ JQuery :
1-Hide the SharePoint control that represent the field value using CSS and give the span container an ID “Ex: spanTitle” :
2-Write the HTML “img” element with attribute “alt” empty and give it an id “Ex:exampleImage” :
3-Write these lines of JQuery that will fetch the value from the hidden span and put it to the “alt” attrbuite in the “img” element :
I Written this script to bulk delete old completed workflow tasks with related history items by specify the date that script will stop delete until it.
The script were treated to deal with a huge number of data.
Click here to download The script
Click here to download from TechNet Gallery
1. Read the Instructions in the top of the file to set the script parameters
Script Instructions part
Table of list template IDs
Programming over SharePoint XML files needs List Template ID in many cases “List definitions xml , site deifnations xml , event receivers xml ,etc..) , here is a table for list template IDs
When you create a new SharePoint event receiver from Visual Studio the Visual Studio asks you “What item should be the event source” – ” see image below”
For example if you choose the list template “Survey” that means your event receiver will applied in all lists from the type survey , but in the real work you need to specify a list instance which the event receiver will apply to it .
We will describe it by a full example “the full code in the end of the post for copy”
In this example we will create 2 classes , the “Task” class which has the task properties and the “TasksGroupedItem” which has 3 properties:
-Task day : it will contain the task day that we will group by
-List<Task> : it will contain list of tasks per Task Day
Then we will create a function that takes List<Task> and return List<TasksGroupedItem> , here is the code