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 😀
- 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 :