Conditional Compilation Symbols Propagation

I ran into a very confusing issue where pre-processor symbols were not being defined when building via xbuild. My investigations uncovered the fact that the the symbols defined by default when created within Visual Studio for Mac were not all propagated to the corresponding .csproj. Check this out.

Only the "DEBUG" symbol is defined in the .csproj file. And in Visual Studio, I have no idea where it's getting the UNIFIED and MACOS symbols.

To get them into the .csproj file without manually editing the .csproj file, I added a test symbol in both Release and Debug configurations within Visual Studio. And then I then removed the test symbol.

I've attached my barebones Mac Library project.

And here's my environment.

=== Visual Studio Community 2017 for Mac ===

Version 7.1.3 (build 1)
Installation UUID: 52841cf1-dbf0-469c-a714-a263f1d0573b
Runtime:
Mono 5.2.0.224 (d15-3/14f2c81) (64-bit)
GTK+ 2.24.23 (Raleigh theme)

Package version: 502000224

=== NuGet ===

Version: 4.3.0.2418

=== .NET Core ===

Runtime: Not installed
SDK: Not installed
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.5
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 8.3.3 (12175.1)
Build 8E3004b

=== Xamarin.iOS ===

Version: 10.12.3.3 (Visual Studio Community)
Hash: 8a391069
Branch: d15-3
Build date: 2017-08-28 16:51:11-0400

=== Xamarin.Android ===

Version: 7.4.3.1 (Visual Studio Community)
Android SDK: /Users/allan/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
6.0 (API level 23)
7.1 (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 26.0.0
SDK Build Tools Version: 25.0.3

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin.Mac ===

Version: 3.6.3.3 (Visual Studio Community)

=== Xamarin Inspector ===

Not Installed

=== Build Information ===

Release ID: 701030001
Git revision: ba94259b26824844f4d2c76c794738eb75b85726
Build date: 2017-08-25 16:28:43-04
Xamarin addins: ee499cfb63ae406b1e394bf6a159ad2953f7fab6
Build lane: monodevelop-lion-d15-3

=== Operating System ===

Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
Thu Jun 15 17:36:27 PDT 2017
root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64

Posts

Sign In or Register to comment.