C# / Xamarin constants in shared project

298 Views Asked by At

I'm creating a Xamarin shared project (but this could apply to C#/Visual Studio in general) that I'd like to reuse in more than one solution.

Some of the classes use constant strings to define IDs and similar, for example:

private readonly string CLIENT_ID = "myID";
private readonly string USERPOOL_ID = "myUserPool";

Is there a way to define some kind of environment variable or macro, so I can specify different IDs for different projects? I would like to achieve something like this:

private readonly string CLIENT_ID = $(CLIENT_ID);
private readonly string USERPOOL_ID = $(USER_POOL_ID);
0

There are 0 best solutions below