Monday 28 December 2015

Issues with Visual Studio

We frequently face some strange issues happening with Visual studio SharePoint projects
- On publishing the wsp, the Visual Studio crashes and asks the programmer to close or repopen it
- The list definition and site columns schema always open in xml and unable to view them in grid

The reason behind them is not setting the site url property of the project. On setting the url, the problem is solved.

Wednesday 15 July 2015

Workflow 2013 custom activity not visible in toolbox

Did you create custom workflow activity in a project different from workflows project?
Are they in different namespaces?
Is the custom created activity not displayed in toolbox even for the same SharePoint Site?
 


The custom workflow activity project needs to be deployed explicitly in GAC for the workflows to identify. To confirm this create string name key for the project, open the Visual Studio command prompt and register the dll in GAC.

Instead of manual effort the same can be done as part of the SharePoint packaging itself. Follow the below steps to do it:


1. Right click the Custom workflow project and select Properties
2. Set the 'Include Assembly in package' to "False". This is true by default
3. Go to Package.package file and select "Advanced" tab
4. 3 assemblies need to be added here
  •  Click on 'Add existing assembly'
  •  Select "\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies\Microsoft.SharePoint.DesignTime.Activities.dll"
  •  Select "\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies\Microsoft.SharePoint.DesignTime.Activities.Design.dll"
  • Click on "Add from Project Output"
  • Select the dll of workflow custom activity

5. Add the reference of this assembly to the workflows project
6. Restart the visual studio instance containing workflows project
7. Now the custom workflow activity created should be available in the toolbox
 

Monday 30 March 2015

Workflows communication exception

I had deployed a workflow wsp using powershell and while activating a feature, I received an exception in browser:

Microsoft.Workflow.Client.WorkflowCommunicationException: The request was aborted: The request was canceled. Client ActivityId : <<guid>> ---> System.Net.WebException: The request was aborted: The request was canceled.


Though all services were running, workflow manager was connected; there was no clue why this happened. Just by resetting the IIS, the issue got solved.

Saturday 28 March 2015

Apps with workflows installation

While developing a SharePoint hosted app with workflows, it got deployed successfully from Visual Studio. Which means workflow was created as part of app and it got installed. The workflows got triggered successfully too in the development site. But when the app was installed in a different web application by uploading the .app file to the app catalog, there were issues. 

Problem:

The uploaded app properties say the app is valid. But ‘View details page’ displayed an error “Sorry, this app is not supported on your server”.

1.       But app without workflows had no issue
2.       App with workflow could be deployed using Visual Studio
3.       Only deployment through app catalog was not happening

Issue:

As per MSDN: https://msdn.microsoft.com/en-ca/library/jj819804.aspx , appprerequisites gets added to the Appmanifiest.xml file.

<AppPrerequisites><AppPrerequisite Type=”Capability” ID=”{CDD8F991-B459-4512-8048-03D5A03FF27E}” MinimumVersion=”15.0.0.0” /></ AppPrerequisites>

This is not seen in the VS studio -> (physical file) Appmanifiest.xml file. The above tag get added only after publishing the app.

Fix: Remove the prerequisites from the appmanifest file.

Steps:


1.     Rename the .app file to .zip
2.     Open the .zip file
3.     Copy and paste the appmanifest.xml file some where
4.     Remove the above highlighted tag  and save
5.     Drag and drop the above saved file to the zip file.
6.     Rename the .zip to .app and proceed with installation steps

Result:

App got installed and workflow got triggered for the associated item.