by December 3, 2012
onFor some strange reasons it is not possible to add folders to F# projects in Visual Studio. Neither the 2010 edition nor the new 2012 version supports such an important feature. However the good message is that it is indeed possible to add folders on your own.
To add folders to your F# project you have to edit the project file (*.fsproj
) by hand using your favorite text editor. Search for the item group with all the Compile
statements:
<!-- ... -->
<ItemGroup>
<Compile Include="Parser.fs" />
<None Include="Script.fsx" />
</ItemGroup>
<!-- ... -->
Now you just have to add your new Compile
, Resource
or whatever statements to that item group:
<!-- ... -->
<ItemGroup>
<Resource Include="resources\images\icon.png" />
<Resource Include="resources\images\error.png" />
<Compile Include="Parser.fs" />
<None Include="Script.fsx" />
</ItemGroup>
<!-- ... -->
After you matched your file system structure with your file paths you can reload your project and enjoy your ordered project structure. Now you can even add subfolders to already existing folders via the Visual Studio context menu.