StefH / ProxyInterfaceSourceGenerator

This project uses Source Generation to generate an interface and a Proxy class for classes. This makes it possible to wrap external classes which do not have an interface, in a Proxy class which makes it easier to Mock and use Dependency Injection.
MIT License
38 stars 5 forks source link

Build error on missing namespace #42

Closed rogeralsing closed 1 year ago

rogeralsing commented 1 year ago

If the Interface with the proxy attribute is defined in a file without a namespace. this results in a build error as the generated e.g.

using Akka.Actor;

//namespace ConsoleApp66;  <- no namespace

[ProxyInterfaceGenerator.Proxy(typeof(LocalActorRefProvider))]
public partial interface ILocalActorRefProvider
{
}

code ends up looking like so:

namespace.  /*nothing here*/
{
// all the proxy stuff

}
StefH commented 1 year ago

Should be fixed in https://github.com/StefH/ProxyInterfaceSourceGenerator/pull/46