Showing posts with label deployment. Show all posts
Showing posts with label deployment. Show all posts

Wednesday, November 20, 2013

How to: Debug a timer job deployment?

Intro:
So I've been tasked with writing a Custom SharePoint timer job.
So I googled it up and I followed Andrew Connell's article
http://www.andrewconnell.com/Creating-Custom-SharePoint-Timer-Jobs

Symptoms:
After I made modifications to suit my needs I go and try to deploy it (by pressing F5). After which I get a very descriptive message:
Error occurred in deployment step 'Activate Features': Object reference not set to an instance of an object.
So I comment out every line of the "Activate Features" code and try to diagnose it. Breakpoints don't seem to work.

Workaround/Resolution:
Insert
System.Diagnostics.Debugger.Launch();
into your code and if all goes right Visual Studio will pick up the task of debugging your code.

SharePoint 2013: RemoteAppUrl is not specified.

Situation: I've built a Provider Hosted SharePoint 2013 app. It's been working happily until I went to "clean up the project". I made a couple of changes to the IIS Web App project properties and now when I try to deploy my app to SharePoint I get "RemoteAppUrl is not specified."
But it doesn't provide any clues as to how this can be fixed.

Fix:
In Solution Explorer.
Right click on the Web App and click Properties.
Open up the "Web" section.
Under Servers check "Apply server settings to all users (store in project file)".

Why?:
I believe if you have this unchecked Visual Studio won't set the "RemoteAppUrl" in the AppManifest.xml and thus the message.