本文整理匯總了C#中AppHost.Init方法的典型用法代碼示例。如果您正苦於以下問題:C# AppHost.Init方法的具體用法?C# AppHost.Init怎麽用?C# AppHost.Init使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AppHost
的用法示例。
在下文中一共展示了AppHost.Init方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TestFixtureSetUp
public void TestFixtureSetUp()
{
LogManager.LogFactory = new ConsoleLogFactory();
appHost = new AppHost();
appHost.Init();
appHost.Start("http://*:1337/");
}
示例2: TestFixtureSetUp
public void TestFixtureSetUp()
{
startedAt = Stopwatch.StartNew();
appHost = new AppHost();
appHost.Init();
appHost.Start("http://*:1337/");
}
示例3: Init
public void Init()
{
var configure = Configure.With()
.DefaultBuilder()
.DefiningCommandsAs(t => t.Namespace != null && t.Namespace.EndsWith("Commands"))
.DefiningEventsAs(t => t.Namespace != null && t.Namespace.EndsWith("Events"))
.RunTimeoutManager()
.Log4Net()
.XmlSerializer()
.MsmqTransport()
.IsTransactional(true)
.PurgeOnStartup(false)
.RavenPersistence()
.Sagas()
.RavenSagaPersister()
.UnicastBus()
.ImpersonateSender(false)
.LoadMessageHandlers();
const string listeningOn = "http://*:8888/";
var appHost = new AppHost();
appHost.Init();
appHost.Start(listeningOn);
Configure.Instance.Configurer.ConfigureComponent<RavenDocStore>(DependencyLifecycle.SingleInstance);
Configure.Instance.Configurer.ConfigureComponent<TimeoutCalculator>(DependencyLifecycle.InstancePerUnitOfWork);
Configure.Instance.Configurer.ConfigureComponent<SmsService>(DependencyLifecycle.InstancePerUnitOfWork);
Configure.Instance.Configurer.ConfigureComponent<SmsTechWrapper>(DependencyLifecycle.InstancePerUnitOfWork);
var bus = configure.CreateBus().Start(); //.Start(() => Configure.Instance.ForInstallationOn<NServiceBus.Installation.Environments.Windows>().Install());
appHost.Container.Register(bus);
appHost.Container.RegisterAutoWiredAs<RavenDocStore, IRavenDocStore>();//.RegisterAs<IRavenDocStore>(new RavenDocStore());
}
示例4: Application_Start
protected void Application_Start(object sender, EventArgs e)
{
Licensing.RegisterLicenseFromFileIfExists(@"~/appsettings.license.txt".MapHostAbsolutePath());
var appHost = new AppHost();
appHost.Init();
}
示例5: Run
public override int Run(string[] remainingArguments)
{
var packageRepositories = new List<IPackageRepository>();
if (!string.IsNullOrEmpty(Json))
packageRepositories.Add(new JsonFilePackageRepository(Json));
if (!string.IsNullOrEmpty(Xml))
packageRepositories.Add(new XmlFilePackageRepository(Xml));
if (!string.IsNullOrEmpty(StashBaseUri) && !string.IsNullOrEmpty(StashProjectKey))
packageRepositories.Add(new StashPackageRepository(StashBaseUri, StashProjectKey, StashUsername, StashPassword, StashSshInsteadOfHttp));
if (packageRepositories.Count == 0)
packageRepositories.Add(new InMemoryPackageRepository());
var listener = string.Format("http://*:{0}/", Port);
var appHost = new AppHost();
appHost.Init();
appHost.Container.Register<IPackageRepository>(_ => new AggregatePackageRepository(packageRepositories));
System.Console.WriteLine("Listening on {0}", listener);
appHost.Start(listener);
Thread.Sleep(Timeout.Infinite);
return 0;
}
示例6: Application_Start
protected void Application_Start(Object sender, EventArgs e)
{
// Make package reposiroties.
var packageRepositories = new List<IPackageRepository>();
// Get bowerRegistryConfigurationSection
var bowerRegistryConfigurationSection = ConfigurationManager.GetSection(BowerRegistryConfigurationSection.SectionName) as BowerRegistryConfigurationSection;
if (bowerRegistryConfigurationSection != null)
{
// Get custom repositories.
foreach (var packageRepository in bowerRegistryConfigurationSection.Repositories)
{
if (packageRepository.GetType() == typeof(InMemory))
packageRepositories.Add(new InMemoryPackageRepository());
if (packageRepository.GetType() == typeof(XmlFile))
packageRepositories.Add(new XmlFilePackageRepository(((XmlFile)packageRepository).FilePath));
if (packageRepository.GetType() == typeof(JsonFile))
packageRepositories.Add(new JsonFilePackageRepository(((JsonFile)packageRepository).FilePath));
if(packageRepository.GetType() == typeof(Stash))
{
var stash = packageRepository as Stash;
packageRepositories.Add(new StashPackageRepository(stash.BaseUri, stash.ProjectKey, stash.Username, stash.Password, stash.UseSSH));
}
}
}
// Start app.
var appHost = new AppHost();
appHost.Init();
appHost.Container.Register<IPackageRepository>(_ => new AggregatePackageRepository(packageRepositories));
}
示例7: Main
public static void Main(string[] args)
{
Console.WriteLine ("Starting monotest service");
// configure JSON serializer
JsConfig.EmitCamelCaseNames = true;
var exit = false;
var signals = new[] {
new UnixSignal(Signum.SIGINT),
new UnixSignal(Signum.SIGTERM)
};
var host = new AppHost();
host.Init();
host.Start("http://+:8080/");
// wait for termination
while (!exit)
{
var id = UnixSignal.WaitAny(signals);
if (id >= 0 && id < signals.Length)
{
if (signals[id].IsSet)
exit = true;
}
}
Console.WriteLine("Terminating monotest service");
}
示例8: Application_Start
protected void Application_Start(object sender, EventArgs e)
{
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
var host = new AppHost();
host.Init();
}
示例9: Main
public static void Main()
{
// Very simple console host
var appHost = new AppHost(500);
appHost.Init();
appHost.Start("http://*:9000/");
Console.ReadKey();
}
示例10: AppHost
public static void Запустить()
{
const string listeningOn = "https://*:1337/";
var appHost = new AppHost();
appHost.Init();
appHost.Start(listeningOn);
Console.WriteLine("AppHost Created at {0}, listening on {1}", DateTime.Now, listeningOn);
}
示例11: Main
static void Main(string[] args)
{
App = new AppHost();
App.Init().Start("http://*:3337/");
NSApplication.Init();
NSApplication.Main(args);
}
示例12: Main
static void Main(string[] args)
{
var appHost = new AppHost();
appHost.Init();
appHost.Start("http://localhost:2211/");
Console.Read();
}
示例13: TestFixtureSetUp
public void TestFixtureSetUp()
{
LogManager.LogFactory = new ConsoleLogFactory();
startedAt = Stopwatch.StartNew();
appHost = new AppHost();
appHost.Init();
appHost.Start(ListeningOn);
}
示例14: OnTestFixtureSetUp
public void OnTestFixtureSetUp()
{
LogManager.LogFactory = new ConsoleLogFactory();
appHost = new AppHost { EnableRazor = false };
appHost.Plugins.Add(new MsgPackFormat());
appHost.Init();
appHost.Start(ListeningOn);
}
示例15: Main
private static void Main(string[] args)
{
var appHost = new AppHost();
appHost.Init();
appHost.Start("http://*:1337/");
System.Console.WriteLine("Listening on http://localhost:1337/ ...");
System.Console.ReadLine();
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
}