EDIT: I edited the whole question, as this applies not only to Unity3D, but all .sln projects as well.
I have a Visual Studio code installation (not Visual Studio, but this: https://code.visualstudio.com/ ) on my Macbook at work. VSCode otherwise works fine with regular and Unity3D projects. I get Intellisense for all classes, including Unity3D, such as GameObject. Therefore, I believe that my installation and startup sequence are correct.
The only problem I have is that VSCode does not seem to recognize the constants defined in the .csproj files. At first I noticed this with some Unity3D plugins, but it is also saved in regular Visual Studio projects.
My sample project is a dummy application downloaded from the Internet, but it works completely on MonoDevelop. This is my code.
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DummyConsoleApplication { class Program { static void Main(string[] args) { tester(); } #if DEBUG static void tester(){ } #endif } }
A function call in Main raises an exception not found in the editor, but it compiles fine, because the .csproj file has the following line:
<DefineConstants>DEBUG;TRACE</DefineConstants>
Any verification, if this is normal behavior for VSCode, would be greatly appreciated. In addition, if anyone knows of any solution, even hacking, to get past this error and force Intellisense to autofill will also help.
The error I get is:
The name 'tester' does not exist in the current context [DummyConsoleApplication]
My hardware is a Macbook with Yosemite, and my compiler is dnx-mono.1.0.0-beta4.
c # constants csproj visual-studio-code
Quido3
source share