R
RayLopez99
I don't think it's possible to mix F# and C# together in the same project. Anybody done this?
RL
RL
RayLopez99 said:I don't think it's possible to mix F# and C# together in the same project.
Anybody done this?
In Visual Studio, a "project" is a single compilation unit. You cannot
mix
different languages in the same project.
Peter Duniho said:In Visual Studio, a "project" is a single compilation unit. You cannot
mix
different languages in the same project.
Not in the application's own project, no. But it can reference managed
assemblies written in any other language.
Like your first two points, this is just another example of the
fundamental
rule: you cannot mix languages within a project, but any project can
reference managed assemblies written in any language.
Jeff Johnson said:He should have said SOLUTION, not project.
No, I meant PROJECT not solution. You can mix different languages in the
same PROJECT, provided its a web forms project and not an application.
I don't think it's possible to mix F# and C# together in the same project.
Anybody done this?
Never used F#, but given that you can mix C# and VB.Net in the same
project (with certain caviats) then I would have though you should also
be able to mix C# and F#.
My notes on mixing C# and VB.Net are here:
http://www.cryer.co.uk/brian/mswinswdev/ms_dotnet_mix_csharp_and_vb.htm
and I would expect the same to apply when mixing C# and F#, but like I
said, I've never used F# so haven't tried.
The caviats when mixing C# and VB.Net (which I'd expect still to apply)
are:
1. You cannot mix within a class library - but you can have multiple
class libraries, so one could bein C#, one F# and another in VB.Net.
2. In a desktop application you cannot mix languages.
3. In a web forms project you can have one form in one language and
another in a different languages. Also with web forms you cannot mix
languages inside the App_Code folder, but you can have a separate
App_Code folder for each language. Details in my notes, link given above.
Like your first two points, this is just another example of the fundamental
rule: you cannot mix languages within a project, but any project can
reference managed assemblies written in any language.
Oh, Web. I don't give a rat's ass about the Web, so that's why I never knew
that. Well, that plus I never would have even considered doing such a thing
in the first place and therefore would have never looked to see if it was
even possible.
If you are willing to create a custom build procedure you can
create your console exe from multiple languages as well.