Sharepoint 2013 Journey

Monday, January 13, 2014

File new empty sharepoint 2013 project

Specify the settings and click finish

Right click the project and select add new item

Select module and click add

The site page module was automatically added to the feature

Rename the feature to siteapppages

Double click on the feature in solution explorer and modify the title, when the feature is activated the logic inside the module will kick in

Rename sample.txt to sitepage.aspx and then hit yes

View the elements.xml file was automatically updated

Add this line of code to position a hyperlink in the top of the page

Open the aspx file and type in some code, view the help that kicks in to add the sharepoint v4 master page

Remove the hard coded path to the master page file and enter this path, which uses the master page specified at the spweb level

Add this standard code inside the content placeholder main

Fire up sharepoint designer and click on open site

Type in the sharepoint site url and click open

Click on all files to view the virtual file system

In visual studio right click the project and deploy, it will be packaged as a wsp file, deployed and the feature activated

Refresh the page, the site page link appears, click on it

View the site page with content

In sharepoint designer, hit f5, view the sitepagemodule folder appears, click on it

View inside the aspx file

Navigate to the 15 hive logs folder and open the last log file

Here do a search for an error guid for example and find more information to fix a bug

Download uls viewer to format the log files an a more structured way

Run these commands in sharepoint 2013 management shell window to enable the developer dashboard

View the developer dashboard icon, click on it

Click on uls, to view the log file

Open the web.config of the sharepoint site

Change callstack from false to true

Change custom errors from on to off

Set compilation to debug true

Navigate to the web config in the 15 hive layouts folder, the config for application pages

Change custom errors to off

Go into visual studio and remove the end of line semi colon and deploy the app

Navigate to sitepage and get the yellow screen of death, a detailed error message

Open the site page in sharepoint designer

Insert the semi colon and hit the save button

Get a new error message that inline code blocks are not allowed, the app is running under full trust

In sharepoint designer navigate to all files and delete the sitepagemodule folder

Goto visual studio, add the semicolon, hit the save button and redeploy the app

Default Success Warning Important Info Inverse
B S W I ? O