0
我想南希支持網站與Nancy.Hosting.Aspnet
依賴項在一個VS項目和WCF服務託管此網站的專用項目。測試性能並有能力選擇使用IIS或我自己的服務的背後的想法。南希網站和南希wcf主機在不同的項目
對於WCF項目的引用,我添加了網站項目。如何以這種方式主辦南希?
如何告訴Nancy搜索不在當前可執行文件中的模塊,而是在附加的DLL中?應該滿足什麼條件?現在最好的猜測是讓命名空間同意,但現在沒有運氣。如果它幫助這裏是我使用的是從WCF可執行文件運行南希代碼(它是標準的):
class Program
{
private static readonly Uri BaseUri = new Uri("http://localhost:1234/");
static void Main(string[] args)
{
AppDomainAssemblyTypeScanner.LoadAssemblies("Basta.dll");
using (CreateAndOpenWebServiceHost())
{
Console.WriteLine("Service is now running on: {0}", BaseUri);
Console.ReadLine();
}
}
private static WebServiceHost CreateAndOpenWebServiceHost()
{
var host = new WebServiceHost(
new NancyWcfGenericService(new Basta.Bootstrapper()),
BaseUri);
host.AddServiceEndpoint(typeof(NancyWcfGenericService), new WebHttpBinding(), "");
host.Open();
return host;
}
}
我使用的方法從this question(通過調用AppDomainAssemblyTypeScanner.LoadAssemblies
),但沒有工作,很遺憾。