Interface in different namespace causes a silent build failure
Thanks for this great project! Here's an issue I've stumbled across.
When implementing an interface on a partial class, if the interface resides in a different namespace than the class, the build silently fails.
Foo.cs:
using RootNamespace.Inner;
namespace RootNamespace { /* builds / //public sealed partial class Foo / Adding IBah doesn't build */ public sealed partial class Foo : IBah { } }
Foo.Advanced.cs:
namespace RootNamespace { public sealed partial class Foo { } }
IBah.cs:
namespace RootNamespace.Inner { public interface IBah { } }
Try declaring both partials as implementing IBah.
Ok that works. Thanks Nikhil.
While it's not a big deal, if you wanted to use partials and linked files across projects you may not want to share the interface. It sounds like an edge case, but perhaps not so much because the application I'm building takes this approach. It is an SPA with one page for the 'main' application and another page that is a slimmed-down set of views for unauthenticated users. It uses linked files.
Cheers, Daniel
I think I understand your scenario. Its clearly a bug, but wanted to send you a workaround, in case it helped unblock you.
Potentially, there is a way to share code using a helper class, rather than partials off of the same class?
Thanks Nikhil, I appreciate you getting back to me so fast with a work around.
Cheers, Daniel