Hello,
I have a problem with constants defined inside .csproj file of Xamarin Forms app. I have defined additional keyword for AppStore configuration there and added some #if
blocks to swap some ids depending on that keyword. I have just realised that #if
block works only when target platform is set to "AnyCPU". This is fine for android build but for iOS platform it is set to "iPhone" and the #if
does not work as I have expected.
I have traced it that .csproj has definition:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore |AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\AppStore</OutputPath>
<DefineConstants>APP_STORE;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
I have changed it to:
<PropertyGroup Condition=" '$(Configuration)' == 'AppStore' ">
<Optimize>true</Optimize>
<OutputPath>bin\AppStore</OutputPath>
<DefineConstants>APP_STORE;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
but that did not help.
I have expected that changing to AppStore configuration will affect the #if
block regardless the platform. But that's not working this way.
Anyone have an idea what can I do to make it work?