views:

60

answers:

2

I am using Visual C# Express 2010 to develop an application for the Unity3D game engine, which only supports C# 2.0. That is, I am only using it to edit code, but the compilation is done by Unity.

I'm wondering if there is a way to configure Visual C# to edit C# 2.0, so that, for example, it yells if I (out of habit) try to use a var declaration or foo => bar function. Thanks!

A: 

If you go to your application properties and change the Target Framework you should be good to go or do you mean individual files without a project?

BuildStarted
This changes the DLLs that can be referenced, but does not change the compiler/language itself.
Brian
It doesn't also change the intellisense?
BuildStarted
This doesn't actually work because the `var` keyword is a compiler feature and still works even if you're targetting the 2.0 version of the framework. I believe the problem is that luqui is using a compiler that doesn't support `var`, but using Visual Studio to edit the files. I don't *think* it's possible...
Dean Harding
Thanks for the heads up, I'll keep that in mind. :)
BuildStarted
+2  A: 

I think go to the project properties window, then the 'build' tab, and click 'advanced', and there's a way to set the language version. (Don't have it handy now to verify it.)

Brian
Thanks, I set it to ISO-2. :-D
luqui