This is what i infer from the details you have provided. That there is a file in your project named as Shared_Layout.cshtml. In this file you have got an object on line 36,37,38 or 39 which you are trying to use without instantiating it first.
Now, how will you know what is null. It is very simple as well. Click on the line 36 and press F9. It will place a break point in your application. Now press F5 it will start the debug process. Now logoff and your debugger will stop at the line you placed the debugger. Now you can see what is null.