Suppose I have a class library with some conditional compilation, that eventually gets built to MyPortable.dll and MyPortable.X.dll, where the latter is the version compiled with the conditional enabled.
Then I have my "Core" project which references "MyPortable.dll". So far so good.
However, my problem lies in the third project (the "App"), which has a reference to "Core", but needs to use "MyPortable.X.dll" (which is a different build that "Core" uses), but because "Core" is linked against to "MyPortable.dll", my "App" ends using that same version as well, instead of "MyPortable.X.dll".
Is there any way to do that? The code is something like this:
MyPortable
namespace MyPortable
{
public class Person {
public string Name { get; set; }
}
public class Something {
public List<Person> GetPersons() {
List<Person> l = new List<Person>();
l.Add(new Person { Name = "Name 1" });
#if PLATFORM_X
l.Add(new Person { Name = "Name 2" });
#endif
return l;
}
}
}
I first compile MyPortable without "PLATFORM_X" enabled, and then I compile again, this time with the flag turned ON. File references are below (note that I am referencing Core.csproj directly):
Core\References\MyPortable.dll
App\
\References\Core.csproj
\References\MyPortable.X.dll