import a static method
问题 How can I import a static method from another c# source file and use it without "dots"? like : foo.cs namespace foo { public static class bar { public static void foobar() { } } } Program.cs using foo.bar.foobar; <= can't! namespace Program { class Program { static void Main(string[] args) { foobar(); } } } I can't just foobar(); , but if I write using foo; on the top and call foobar() as foo.bar.foobar() it works, despite being much verbose. Any workarounds to this? 回答1: This is the accepted