views:

274

answers:

3

Is there a way for me to create multiple projects using different languages under 1 solution in VS 2008? If so, how?

+5  A: 

Just create them. A solution can happily hold projects of different languages. I have C# and VB.NET projects sitting in the same solution without a problem.

What you can't do is mix languages in the same project.

Oded
It is possible to mix languages in the same .NET assembly (by compiling different modules with different compilers). However, this scenario is not supported by the Visual Studio IDE, and is therefore pretty useless for all practical purposes.
Christian Hayter
If I recall correctly, in VS2002 when you right click the solution, there was an option to add a project of a different language. I don't see that in 2008.I must be blind or something. I can't find that option now. Where do I go to do this?
StackOverflowNewbie
+1  A: 

You will also need attribute "CLSCompliant" to ignore types/members which are not cls compliant.

For instance, if you are using C# and VB project, you will need to exclude methods with same signature but difference in case (VB is not case-sensitive)

        [CLSCompliant(false)]
        public static string GetTypeName() {
            return "SomeBase";
        }

        [CLSCompliant(false)]
        public static string getTypeName() {
            return "somBase";
        }
Amby
A: 

As Oded says, you just create them. Do this by right-clicking the Solution node, selecting Add > New Project, selecting the language and project type you want, and giving it a name.

The only times I know of when this doesn't work are:

  1. When your Always show solution option is not checked (under Tools > Options > Projects and Solutions)

  2. When you don't have both languages installed, for example if you installed Visual Basic 2008 Express Edition without Visual C# 2008 Express Edition or vice versa, or if you deselected one of the languages during installation. Note that except for the express edition, each edition contains all languages by default.

If you are having problems I would verify neither of the above problems applies. Just check the Tools > Options setting and check the Installed products list under Help > About Microsoft Visual Studio. If you need to change the Installed products list, just rerun VS.NET setup (or the appropriate Express edition setup).

Ray Burns