«

»

Apr 19

Workflow design in Visual Studio 2005

Well that was an interesting few hours this afternoon following Nick’s article on creating workflow within Visual Studio 2005 for SharePoint. I got as far as creating all the InfoPath structures, and then when I went to edit the workflow.cs in Workflow Designer, I was faced with a Class Script and Nick had a pretty picture?.. hmm what went wrong..

Well the key difference is that Nick is developing his workflows on a Virtual machine that has Visual Studio and SharePoint installed.. I don’t.. even though I have the .Net 3.0 foundation and everything else loaded, I don’t have some of the key DLL’s that are needed..

How does this manifest itself I hear you say.. Well it’s not that obvious whats wrong, other than the fact that you don’t get the pretty workflow designer window and the relevant tools. There is however 3 Warnings in the error window stating that “The referenced component ‘Microsoft.SharePoint’ could not be found” , this is also joined by entries for Microsoft.SharePoint.WorkflowActions and Microsoft.Office.Workflow.Tasks.

The resolution for this is to copy the relevant files from a server with these assemblies already installed and then registering them in your global assembly cache (GAC).

Firstly, if you don’t have this created, create the following directory on the machine with Visual Studio 2005 loaded on it..

c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI

Now, from the same location in the SharePoint servers 12 Hive, copy the following files into that location:-

    Microsoft.SharePoint.dll
    Microsoft.SharePoint.Security.dll
    microsoft.sharepoint.WorkflowActions.dll
    microsoft.office.workflow.tasks.dll

This resolves the issue with the references and permits the project to open properly without errors, but now, if you double click on the workflow.cs entry you get the following error:-

Could not load file or assembly ‘Microsoft.SharePoint.WorkflowActions.intl, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’ or one of its dependencies. The system cannot find the file specified.

To the same location as before, now copy the following 2 files from the SharePoint server:-

c:\WINDOWS\assembly\GAC_MSIL\Microsoft.SharePoint.WorkflowActions.intl\12.0.0
.0__71e9bce111e9429c\microsoft.sharepoint.WorkflowActions.intl.dll
c:\WINDOWS\assembly\GAC_MSIL\Microsoft.SharePoint.WorkflowActions.intl.resour
ces\12.0.0.0__71e9bce111e9429c\microsoft.SharePoint.workflowactions.intl.reso
urces.dll

(You’ll have to cut and paste the above into notepad and remove the carriage returns as they wouldn’t paste into the blog properly for some reason..)

Now the last part.. Open an explorer window on your development to the folder you just created, and open a second to c:\windows\assembly

Now drag all 6 files from the ISAPI folder and drop them onto the C:\windows\assembly folder to register them with the GAC. (Note, the files won’t copy, it’ll just create the references you need..)

Now run VS2005 once more and start workflowing to your hearts content..

Many thanks to Gudjon who was the key source for that fix..

15 comments

2 pings

Skip to comment form

  1. baldcat

    have followed this to the letter but when I got to register
    ‘microsoft.sharepoint.WorkflowActions.intl.dll’

    it responsed with
    ‘microsoft.sharepoint.workflowactions.intl.dll’ was expected to contain an assembly manifest

    Any ideas ??

  2. Cimares

    Hmm.. I take it this is when you drop the file onto the GAC.

    Try re-creating the file structure for that particular DLL on your XP machine to explicitly match your SharePoint server that you’re copying from, then re-try the registration. Check what version of the DLL you’re using and I’ll verify that it’s the same version as mine.

  3. dthompson

    Having trouble “copying” the GAC files.

    I go to the assembly folder but can’t “copy” only “uninstall”. Sorry if this is very elemental but I’m not getting it.

  4. Cimares

    Dthomspon, Are you actually in the Windows/assembley/Gac_Msil and directories below?

    You cannot copy directly from C:\windows\assembly as this isn’t a ‘real’ directory. You need to navitage to the ones beneath. The only way to do that is to type C:\windows\assembly\gac_msil\ into your run command, this will open up and explorer window in the right location.

    Cheers.

    Reg

  5. nsaers

    When using Vista and dragging over the DLLs to c:\windows\assembly, I get an access denied message for each DLL file

  6. ndbrad02

    I get the following error when registering in the GAC: The given assembly name or codebase, ‘microsoft.office.workflow.tasks.dll’, was invalid.

    Also, no files with “Microsoft.SharePoint.WorkflowActions.intl” in their name exist anywhere on my SharePoint server.

    If you can help me through this, I’ll be forever indebted to your overweight, SP-addicted a**.

    Thanks, man.

  7. Cimares

    nsaers, Sorry I’m not going to be able to help you, I’ve not used Visual Studio on Vista. It’s going to be something to do with Vista’s locked down security permissions somewhere!

    ndbrad02. Hmm.. what version of SharePoint are you working on? I’m developing against the Enterprise edition, so not sure if there is a difference in what dll’s exist there due to the enhanced functionality.

  8. sumedha_obey

    I spent considerable time struggling with the problem.
    Thanks a lot. this article helped me a lot.

  9. sandandsnow

    Man, this saved a lot of time for me 🙂
    Guess what, I have decided not to go ahead with VS 2005/2008 because it is nearly impossible for me to get those dlls from our company’s centralized server. Instead I am planning to use sharepoint designer. Now I have a doubt, can I integrate Infopath forms (as taskedit forms etc) into workflows created by sharepoint designer?

  10. Cimares

    This is quite an old post… If you want to develop on SharePoint, then the accepted method now is to install Win2K3 onto a Virtual machine, with SharePoint and Visual Studio.. This is far and away the much better method.

    Otherwise, Bamboo solutions do a community kit that will allow you to install SharePoint onto a Vista or XP machine.. I’ve not used it, so not sure how it’ll be for coding against, but it’s worth a google..

    As to Infopath forms in SPD workflows..in short no, I don’t think you can, or that it would be worth the effort.

    Reg.

  11. Matt

    Hi

    I know this is an old post but I thought it would do what I want – my scenario is I have a central Sharepoint install with a couple of servers, and a local copy of VS2008 on my workstation. I want to develop workflows in in VS2008. I am the only developer and installing VS on the Sharepoint box is not viable (because I do a lot of other dev work besides SP…)

    I followed your tips above but when I try to create a new SP state workflow project, I just get “A 32-bit version of Sharepoint is not installed” – any ideas on how to get around this?

  12. Matt

    (fyi, before I followed your tips, I got the “The referenced component ‘Microsoft.SharePoint’ could not be found” error message)

  13. Cimares

    Hi Matt,

    You’re right, this is a very old post and I have to be honest, I really would now shy away from developing SharePoint on a workstation as you are just adding to the pain you’ll receive!!

    Depending on the spec of your workstation, Think seriously about getting VMPlayer or Virtual PC and running Windows Server 2003 with WSS/moss and Visual Studio installed on it. If you have an MSDN or Technet subscription, chances are you are fully licensed for Dev/test environments anyway.

    I’m guessing you have the 64 bit dll’s copied from your server and trying to develop on a 32 bit machine? In this case, I’d go with the VMWare/Virtual PC root and install the 64 bit version of the OS.

    Reg.

  14. Matt

    Hi Reg,

    Thanks for that. Not sure about the 64-bit DLLs bit – it’s a 32-bit install!

    As much as I don’t really want to, I might just go ahead with a local / dev setup. My main concern was licensing – but if dev setups are “OK” then well I guess I’ll go for it.

    My workstation is beefy – but then equally we have a full virtual environment going on – and I’m not sure what would be better – VirtualPC/Server on my Workstation – or a standalone dedicated Sharepoint dev server… hmm. I think I’m edging towards the latter, but I’m not sure how my sys admin will feel about that.

    There’s no way I can replicate our live SP install – but presumably if I installed it as a standalone so everything was all on the same box then it would be “pretty much” OK for basic workflow development stuff – ?

  15. Cimares

    If you are running your Dev system on Virtual PC on your machine, at least you have a lot more control over it?..

    You can just do a standalone SP install using the WSS install from MS, The only thing you won’t really be able to test is anything using Kerberos.

    Reg.

  1. Setup visual studio for sharepoint development

    […] food obsessed IT developer writes about setting up visual studio to develop for sharepoint without having sharepoint installed on the development computer. Nice instructions and saved me […]

Leave a Reply to Setup visual studio for sharepoint development Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.