views:

434

answers:

2

I've installed a complete SharePoint Server (MOSS) 2007 on my dev box + the latest Visual Studio (SP1) + the latest full Windows SDK. According to the Windows Workflow Foundation page http://msdn.microsoft.com/en-us/netframework/dd980558.aspx, that is all I should need to do to be able program against the .NET Workflow APIs.

And yet, all of the projects I build from the standard Workflow templates refer to the assembly System.Workflow and VS complains that that assembly isn't available. I've searched around on my hard drive, and I can't find a file for that assembly anywhere obvious on my disk.

I do find some files that look like they might be that assembly, but they're buried down in wacky places below particular applications like they are runtime support for that app. They don't seem to be what I'm supposed to point VS at.

Can anyone tell me how to fix this problem? Do I need to install something else that I have yet to come across? Are these assemblies already on my system and I just need to know how to point VS at them? I'm stumped.

BTW: I was going to try uninstalling and reinstalling VS, but the installer fails with some very cryptic error message when I try to uninstall.

TIA for any help, and Happy Holidays to all!!!

+2  A: 

There's no assembly named System.Workflow in .NET 3.x: the WF assemblies (in 3.x) are:

  • System.Workflow.Runtime
  • System.Workflow.ComponentModel
  • System.Workflow.Activities
  • System.WorkflowServices (3.5)

You should be able to find all these assemblies in the GAC, and reference them via the Add Reference dialog, .NET tab.

It's possible System.Workflow is a (badly named) SharePoint-specific DLL, in which case, sorry, the above won't help... try the SharePoint install directory or SharePoint SDK install directory. Are the project templates you're using SharePoint templates, or the ones from File > New Project > Visual C# > Workflow?

itowlson
Ah ha. Now I have some real information....I took your advise and tried to add these assemblies. However, all four of them are dimmed out in the Add Reference dialog. I assume this is because the files don't actually exist. If I attempt to find the file at the path listed in the Add Reference dialog, that file does not exist. This is true for all the ones that are dimmed, and not true for all the ones for which a file actually exists and the indicated path.
Steve
So why are these .dll files missing on my system? I'd never done anything but install software prior to this problem's occurrence.
Steve
Aha -- if the assemblies are dimmed out it probably means your project is not targeting the full .NET 3.x framework. (Dimming means "the DLL exists but it's not available in this project.) Go into Project Properties, Application tab, and look for the *Target Framework* combo box (just below the Assembly Name box). Does it say .NET Framework 2.0? If so change it to 3.5. Otherwise, look below it at the *Client-only framework subset* check box. This needs to be *unchecked* as WF is not included in the Client Profile. Any of that help?
itowlson
Could this be a 64-bit OS issue? I'm running 2008 64-bit. Maybe these assemblies are not 64-bit compatible, or something like that. (NOTE: The paths in Add Reference point to "Program Files (x86)". I've looked in "Program Files" and they aren't there either. In fact, as I said in my initial post, there are no files in any of the normal assembly locations that start with "System.Workflow".)
Steve
That didn't help. My project WAS targeted at .NET 2.0, but changing it to 3.5 and closing everything down and relaunching VS doesn't change anything. I didn't think this would help because the paths I mention being dimmed point into a directory named v3.5, so in that context, I'm already dealing with the 3.5 version. Problem is, the .dll files for those assemblies aren't in that directory.
Steve
I doubt it's a 64-bit issue: WF is built for the server, so I can't imagine they'd make it 32-bit only (and nothing else in the .NET framework is 32-bit only!). Though I guess it could be a 64-bit SDK install issue (you said the installer was giving you cryptic errors which may be symptoms of some larger failure). Are the assemblies in the GAC?
itowlson
I think the problem boils down to the fact that "C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Workflow.Runtime.dll" (and the other 3 similar files) aren't on my system. Should I try a reinstall of .NET 3.5? Is it possible that, despite the web page I'm reading saying otherwise, I have to explicitly install a different version of 3.5 than what comes with VS 2K8?
Steve
If the DLLs aren't in the Reference Assemblies / Microsoft / Framework / 3.0 folder, then I'd say you probably have a corrupted installation of the Framework SDK. You may be able to work around this by copying the assemblies from the GAC (assuming they're in there!) to a Lib folder and referencing them there; but even if this works I fear it may be only papering over a deeper problem...
itowlson
Yes, System.Workflow.Runtime IS in the GAC. I assume that's why it shows up in Add Assembly. But its backing .dll file seems to be missing.
Steve
No, you shouldn't need to install a different version of 3.5 than what comes with VS2008 (and SP1). The VS2008 installer (when it works!) installs the Framework SDK including the reference copies of the assemblies.
itowlson
I did just install the SDK per the instructions. Maybe I installed the wrong thing. I installed from the file "6.0.6001.18000.367-KRMSDK_EN.iso".
Steve
Note, all of the errors I got from the installer were upon trying to UNINSTALL. Everything went fine on install.
Steve
(greatly appreciate all your help BTW)
Steve
Hmm, from the Windows SDK download page: "If you do go ahead and install this SDK after VS2008 SP1, please ensure the patch described in Knowledge Base 974479 is applied." Though from the description I can't imagine this would cause the Reference Assemblies problem. I can only suggest doing a repair or a full uninstall-reinstall on VS2008. Sorry, but I'm stumped!
itowlson
Thanks. I just tried doing a Repair on the 3.5 SP1 framework. Went without a hitch, but the .dll files are still missing. I thought to reinstall VS. Unfortunately though, that's where I run into the installer errors. Since I can't uninstall it, I can't reinstall it. I guess I could try using the Windows Installer cleanup tool to blast it. Otherwise, I might be stuck with rebuilding my VM (luckily it IS a VM) from scratch. I wish I at least knew what went wrong so I don't end up right back here again.Thanks again for trying!
Steve
I'm considering going 32-bit this time...just to do something different. Could also go back to Win 2K3.
Steve
+1  A: 

I did a Repair using the .NET 3.5 SP1 SDK distributable, and I believe that this solved the problem. I thought at first that it didn't (as I say in prior comments) because I was looking for the files to show up in the v3.5 assembly directory. The missing files actually go in the v3.0 assembly directory. I later brought up one of the sample projects in VC and noticed that the symbols were now resolving, and sure enough, the missing .dll files were now present.

So I guess that the .NET SDK installer that ships with VS somehow didn't install these .dll files. It took doing a Repair on the SDK to fix the problem.

I'm a happy camper now!

Steve