Switching Between External Aliases Without Re-Writing Code?
问题 extern alias dll1; extern alias dll2; ... public void DoStuff1(){ dll1::NameSpace.Class.Method(); } public void DoStuff2(){ dll2::NameSpace.Class.Method(); } What I'd like to be able to do is: public void DoStuff(alias a){ a::NameSpace.Class.Method(); } alias does not appear to be usable like this. Addendum: dll1 and dll2 are different versions of the same dll. 回答1: Keep code from different aliases in different files, and use partial classes in each file. (Partial classes allow you to write