[英]WireMock.Net API server is not returing data when .NET console application run as Windows service
我已經開始使用Wiremock.Net了 。 當我從.NET控制台應用程序運行時,安裝程序運行正常,下面是代碼
var server = FluentMockServer.Start(new FluentMockServerSettings
{
Urls = new[] { "http://+:8080", "http://localhost:8081/" },
StartAdminInterface = true,
ReadStaticMappings = true,
});
Console.WriteLine("Press any key to stop the wire mock fake server");
Console.ReadLine();
server.Stop();
服務器運行正常http://localhost:8081/__admin/mappings
,映射位於bin\\Debug\\__admin\\mappings
我想使此控制台始終運行,並且我像Windows服務一樣應用了該.NET控制台應用程序 。 當我啟動Windows Service並瀏覽http://localhost:8081/__admin/mappings
它只會返回[]
請參閱此WireMock.Net Wiki頁面,其中介紹了如何將WireMock作為Windows服務運行。
有關完整的工作示例,還提供了安裝程序和批處理文件以
服務,請參閱示例/WireMock.Net.Service
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.