However I still need to pass an assembly to the constructor or I get an exception.
If I don't call the base method the register service does not work.
I've managed to work around this problem by supplying an allembly with a dummy service, but if there is a better way it would be great.
public AppHost()
: base("Web Services")
{
this.RegisterService(typeof(Service1));
this.RegisterService<Service2>();
}
System.ArgumentException was unhandled by user code
Message=No Assemblies provided in your AppHost's base constructor.
To register your services, please provide the assemblies where your web services are defined.
Source=ServiceStack
StackTrace:
at ServiceStack.ServiceHost.ServiceManager..ctor(Assembly[] assembliesWithServices) in C:\src\ServiceStack\src\ServiceStack\ServiceHost\ServiceManager.cs:line 26
at ServiceStack.WebHost.Endpoints.AppHostBase.CreateServiceManager(Assembly[] assembliesWithServices) in C:\src\ServiceStack\src\ServiceStack\WebHost.EndPoints\AppHostBase.cs:line 38
at ServiceStack.WebHost.Endpoints.AppHostBase..ctor(String serviceName, Assembly[] assembliesWithServices) in C:\src\ServiceStack\src\ServiceStack\WebHost.EndPoints\AppHostBase.cs:line 33
at NCommerce.WebApi.App_Start.AppHost..ctor() in C:\Users\yavo\Documents\Visual Studio 2010\Projects\NCommerce\src\NCommerce.WebApi\App_Start\ServiceStackFramework.cs:line 43
at NCommerce.WebApi.App_Start.AppHost.Start() in C:\Users\yavo\Documents\Visual Studio 2010\Projects\NCommerce\src\NCommerce.WebApi\App_Start\ServiceStackFramework.cs:line 275
InnerException:
Cheers,
Yavor