Wednesday, April 28, 2010

More project type tricks

The trick to make an F# project launch in the Visual Studio web server is a further application of a little trick I picked up a while back for Vs2008.

There I wanted to retrofit a Windows Workflow into an existing plain C# library project; which I started by building the workflow in a scratch project and copying the source across -- but then in the copy I lost the designer. So I looked at the project file and immediately I saw

<ProjectTypeGuids>{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

Copying that into the otherwise vanilla C# project not only gave me the workflow designer, but also the workflow and activity items on the Add> menu. There is also a

  <Import Project="$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets" />

but not copying that didn't seem to have any noticeable effect.

And, while I've not yet had cause to look, projects that bring in their own specialist types and designers will presumably have their own GUID values.

Adding

<ProjectTypeGuids>{14822709-B5A1-4724-98CA-57A101D1B079};{F2A71F9B-5D33-465A-A702-920D77279786}</ProjectTypeGuids>

to an F# project gives the extra additions to the menus -- but without templates, and, more importantly partial class support -- you won't get much benefit from them, unlike with the web app launching.

No comments :