Conditional compilation with Visual Studio Code for .NET Core

How can I add conditional compilation symbols in Visual Studio Code? I followed the “.NET Core Development and Debugging on Torizon Using Visual Studio Code” guide for general setup but there is no mention on the topic there.

Are there plans of porting the Torizon Visual Studio Code Extension for MacOS?

Thank you in advance.

Greetings @jaimeibk,

I had to do some research since my knowledge on .NET Core is a little limited. So compared to Visual Studio where you can add/edit symbols via the GUI, for Visual Studio Code it seems you need to edit the csproj file directly.

I tried to find some documentation on this but the best I could find was some stack overflow forums: msbuild - DefineConstants in addition to existing ones in csproj - Stack Overflow

In short though the C# extension for VSCode that we use for NET Core development should support this according to: Support <DefineConstants> from *.csproj -file · Issue #226 · OmniSharp/omnisharp-roslyn · GitHub

So try playing around with this file and see if it works out for you.

As for your other question, I don’t believe we have any plans of making the extension compatible/available for Mac. However I can double-check this.

Best Regards,
Jeremias

Hi, @jeremias.tx

That did work, thank you!

I hope you will release the MacOS extension.

Best,

Jaime

Glad it worked for you. Also I checked on the MacOS support with the team, and there were talks of this and it is possible. However, for the time being we opted to focus on the Windows/Linux support since we don’t have too much users who request Mac support currently. That being said if we reach a critical mass of users asking for Mac support then it’s something we’d undertake.

Best Regards,
Jeremias