kqr
kqr

Reputation: 15028

Shared directory för both one C# and one F# project

So I know you can't mix languages in a single project. However, the current solution at my job is to have, for each logical project, separate subdirecttories and namespaces for the implementations that happen to be written in C# and F#, respectively. This is slightly annoying. I have planned to at least give them the same namespaces, but as I was thinking about it, I realized it would be even more convenient if they could be stored in the same directory!

Then there'd be directories containing both .csproj and .fsproj files, and .cs and .fs source files -- would this be a technical problem?

Upvotes: 2

Views: 78

Answers (1)

scrwtp
scrwtp

Reputation: 13577

It's a weird idea in the same way that putting two C# projects in the same directory would be weird. Even if it would work, it mostly serves to obscure the picture, so why do it in the first place?

You might get it to work as far as physically placing two projects in the same directory goes, but I'd expect you to run into trouble with build toolchains - the idea that each assembly is its own project is its own directory is pretty central to how .NET projects are structured, e.g. artifacts are being output into ./bin and ./obj subdirectories that would typically be indiscriminately cleaned etc.

You'd end up fighting the toolchain, and even if you'd win, I can't honestly see the convenience of having those projects mixed together.

Upvotes: 4

Related Questions