0

I'm at my first developement in Sharepoint. I'm using VS2013 Ultimate with Sharepoint Foundation 2013 on a Windows 2008 R2. I started creating a custom list and some site columns. The first debug runs fine. After I stopped debugging, objects are still listed in Sharepoint:

  • if I try entering the custom list I get a "Sorry, something went wrong" error page;
  • if I enter the property page of a custom site column, I see all the details but if I try saving/deleting it I get the "Sorry, something went wrong", specifying that the feature is not installed.

Subsequent debugs alert of deployment conflicts and some deletions fails (I suppose that is because objects actually don't exist).

Do I need to manually implement a feature event receiver for removing objects upon feature removal?

4
  • Is this a repetitive behavior? If your site has gone corrupt then you could delete and recreate the site/web and start over. See if this behavior is repeated. It seems that you are creating the lists declaratively (through designer) and deploying through a feature. Feature de-activation does not remove the created list. You have to write code in the feature deactivation event receiver to remove any lists that are being created. This is by design to prevent data loss. – Arsalan Shahid Apr 16 '15 at 20:38
  • Yes Arsalan, I'm creating them declaratively, and yes this is a repetitive behaviour. Anyway thank you, I'll implement a feature event receiver together with some more hints from other replies. – En-j Apr 16 '15 at 20:48
  • You need to investigate it further using the SharePoint log.The error on the page should have correlation id. The tool that you need would be the ULS Viewer over here microsoft.com/en-ca/download/details.aspx?id=44020. Select File->Open From->ULS and it will start tracking your log in real time. Reproduce the error, get the correlation id and filter the log by it. Look for the Unexpected or Critical Level events. These are the errors that have occurred. This will give you the idea of what actual error you are facing. – Arsalan Shahid Apr 16 '15 at 20:57
  • could you please reply as an answer instead than a comment? So I can mark it as a valuable answer like it is, – En-j Apr 16 '15 at 23:55
0

You need to investigate it further using the SharePoint log.The error on the page should have correlation id. The tool that you need would be the ULS Viewer over here microsoft.com/en-ca/download/details.aspx?id=44020. Select File->Open From->ULS and it will start tracking your log in real time. Reproduce the error, get the correlation id and filter the log by it. Look for the Unexpected or Critical Level events. These are the errors that have occurred. This will give you the idea of what actual error you are facing.

1
  • not enough reputation to upvote... – En-j Apr 17 '15 at 14:18
1

Launching compilation/packaging/deployment all the same-time with the magic "F5" key commmand is actually a pain in the a**.

I always taught my students to do the all process "by hand": package (aka Publish) the WSP from VS, but then deploy it from PowerShell.

First deploy will be Add-SPSolution followed by Install-SPSOlution.
Subsequent deployments will be a simple Update-SPSolution (unless you added new features betwee both deployments, in which case unsintalling/reinstalling is the simplest approach most of the time). With this scenario, you know excatly what happens to your packages/features.
Once everything is deployed, you may attach your debugger from VS by attaching to the w3wp process. That even allows debugging feature event receivers, while the "F5" approach does not (and has some other drawbacks regarding localization of features).

If you rely on VS, you never exactly know what it does at deployment, and even less when you stop debugging: VS deactivates the features and retracts the solution in your back (which breaks your lists) and sometimes does custom actions you don't know about.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.