HttpPlatformHandler (sürüm 1.2) kullanarak IIS (IIS 10.0) çalıştıran temel bir Suave uygulaması almaya çalışıyorum.Suave App HttpPlatformHandler ile IIS üzerinde barındırılıyor Bağlantı kapatılıyor
Ben
(OK "Hello World")
uygulama IIS ince çalışır ve ben http://localhost/testapp de adıyla kendisine isteklerini yapabilir gibi tek WebPart dönmek olduğunda (TestApp Standart Web altında uygulamanın adıdır sitesi). Ben WebPart gibi
let app =
choose
[ GET >=> choose
[ path "/hello" >=> OK "Hello GET"
path "/goodbye" >=> OK "Good bye GET" ]
POST >=> choose
[ path "/hello" >=> OK "Hello POST"
path "/goodbye" >=> OK "Good bye POST" ] ]
için bir şey daha karmaşık kullanırsanız
Ancak web sitesi açılıyor ama uygulama adına bunu ulaşamaz. Ancak yine de limana ulaşabiliyorum.
Uygulamaya ada göre vurduğumda, bir HTTP 503.2 (hatalı ağ geçidi) yanıtı alıyorum.
Uygulama, HttpPlatformHandler tarafından yürütülen FAKE komut dosyasından başlatıldı. içerik için
, bu uygulamayı başlatır SAHTE script: beklendiği gibi
#r "./tools/FakeLib.dll"
#r "Suave.dll"
open System
open Suave
open Suave.Successful
open Fake
open System.Net
open Suave.Filters
open Suave.Sockets
open Suave.Operators
open System.IO
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
let port = Sockets.Port.Parse <| getBuildParamOrDefault "port" "8083"
let serverConfig =
{ defaultConfig with
logger = Logging.Loggers.saneDefaultsFor Logging.LogLevel.Verbose
bindings = [ HttpBinding.mk HTTP IPAddress.Loopback port ]
}
let app =
choose
[ GET >=> choose
[ path "/hello" >=> OK "Hello GET"
path "/goodbye" >=> OK "Good bye GET" ]
POST >=> choose
[ path "/hello" >=> OK "Hello POST"
path "/goodbye" >=> OK "Good bye POST" ] ]
startWebServer serverConfig (OK "Hello")
//startWebServer serverConfig app
yukarıdaki komut çalışır. Ancak, (OK "Hello")
yerine app
WebPart
kullanırsam, yukarıda açıklanan sorunla karşılaşırım. Burada Bütünlüğü için
HttpPlatformHandler için ayarlanmış web.config: Ben günlükleri inceledim
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<remove name="httpplatformhandler" />
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform
stdoutLogEnabled="true" startupTimeLimit="20"
processPath=".\tools\FAKE.exe"
arguments=".\test.fsx port=%HTTP_PLATFORM_PORT%" >
<environmentVariables>
</environmentVariables>
</httpPlatform>
</system.webServer>
</configuration>
, ama maalesef bir hata olduğunu belirtir şey göremiyorum.
Ben Olay Görüntüleyicisi kontrol ettik ve bir terslik olabileceğini tek ipucu uygulama günlüğüne bu bilgilerin olaydır: Burada
The description for Event ID 1001 from source HttpPlatformHandler cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
uygulama davasından günlüğünün bir kısmıdır (
choose
olmadan), beklendiği gibi çalışıyor mu:
[V] 2016-01-19T02:43:40.6932823Z: initialising BufferManager with 827392 bytes [Suave.Socket.BufferManager]
[I] 2016-01-19T02:43:40.7114149Z: listener started in 20.885 ms with binding 127.0.0.1:18450 [Suave.Tcp.tcpIpServer]
[V] 2016-01-19T02:43:40.8146603Z: 127.0.0.1 connected, total: 1 clients [Suave.Tcp.job]
[V] 2016-01-19T02:43:40.8166665Z: reserving buffer: 811008, free count: 99 [Suave.Tcp.job] [Suave.Socket.BufferManager]
[V] 2016-01-19T02:43:40.8217965Z: -> processor [Suave.Web.httpLoop.loop]
[V] 2016-01-19T02:43:40.8228181Z: reading first line of request [Suave.Web.processRequest]
[V] 2016-01-19T02:43:40.8378128Z: reserving buffer: 802816, free count: 98 [Suave.Web.readMoreData] [Suave.Socket.BufferManager]
[V] 2016-01-19T02:43:40.8498033Z: reading headers [Suave.Web.processRequest]
[V] 2016-01-19T02:43:40.8776578Z: freeing buffer: 802816, free count: 99 [Suave.Web.split] [Suave.Socket.BufferManager]
[V] 2016-01-19T02:43:40.8866594Z: parsing post data [Suave.Web.processRequest]
[V] 2016-01-19T02:43:40.8886553Z: <- processor [Suave.Web.httpLoop.loop]
[V] 2016-01-19T02:43:40.9057610Z: 'Connection: keep-alive' recurse [Suave.Web.httpLoop.loop]
[V] 2016-01-19T02:43:40.9057610Z: -> processor [Suave.Web.httpLoop.loop]
[V] 2016-01-19T02:43:40.9057610Z: reading first line of request [Suave.Web.processRequest]
[V] 2016-01-19T02:43:40.9057610Z: reserving buffer: 802816, free count: 98 [Suave.Web.readMoreData] [Suave.Socket.BufferManager]
[V] 2016-01-19T02:43:45.2531307Z: reading headers [Suave.Web.processRequest]
[V] 2016-01-19T02:43:45.2541141Z: freeing buffer: 802816, free count: 99 [Suave.Web.split] [Suave.Socket.BufferManager]
[V] 2016-01-19T02:43:45.2541141Z: parsing post data [Suave.Web.processRequest]
[V] 2016-01-19T02:43:45.2541141Z: <- processor [Suave.Web.httpLoop.loop]
[V] 2016-01-19T02:43:45.2551164Z: 'Connection: keep-alive' recurse [Suave.Web.httpLoop.loop]
ve burada beklendiği gibi uygulama (choose
aracılığıyla yönlendirme ile) çalışmaz günlük bir kısmıdır:
[V] 2016-01-19T02:44:59.6356127Z: initialising BufferManager with 827392 bytes [Suave.Socket.BufferManager]
[I] 2016-01-19T02:44:59.6537478Z: listener started in 20.987 ms with binding 127.0.0.1:18708 [Suave.Tcp.tcpIpServer]
[V] 2016-01-19T02:44:59.8848907Z: 127.0.0.1 connected, total: 1 clients [Suave.Tcp.job]
[V] 2016-01-19T02:44:59.8879891Z: reserving buffer: 811008, free count: 99 [Suave.Tcp.job] [Suave.Socket.BufferManager]
[V] 2016-01-19T02:44:59.8929862Z: -> processor [Suave.Web.httpLoop.loop]
[V] 2016-01-19T02:44:59.8939749Z: reading first line of request [Suave.Web.processRequest]
[V] 2016-01-19T02:44:59.9068548Z: reserving buffer: 802816, free count: 98 [Suave.Web.readMoreData] [Suave.Socket.BufferManager]
[V] 2016-01-19T02:44:59.9209857Z: reading headers [Suave.Web.processRequest]
[V] 2016-01-19T02:44:59.9259688Z: freeing buffer: 802816, free count: 99 [Suave.Web.split] [Suave.Socket.BufferManager]
[V] 2016-01-19T02:44:59.9338521Z: parsing post data [Suave.Web.processRequest]
[V] 2016-01-19T02:44:59.9378580Z: <- processor [Suave.Web.httpLoop.loop]
[V] 2016-01-19T02:44:59.9518518Z: freeing buffer: 811008, free count: 100 [Suave.Tcp.job] [Suave.Socket.BufferManager]
[V] 2016-01-19T02:44:59.9518518Z: Shutting down transport. [Suave.Tcp.job]
[V] 2016-01-19T02:44:59.9528516Z: 127.0.0.1 disconnected, total: 0 clients [Suave.Tcp.job]
Uygulama yürütüldüğünde bağlantı açılır ve hemen kapanır. Uygulamayı bağlantı noktasına bastığımda yeni bir bağlantı açılır ve hemen kapanır (tekrar).
Uygulama için ana bilgisayar yapılandırmasında yanlış bir şey mi yapıyorum yoksa seçim işlevini kullanma biçimimdeki bir şeyi mi özlüyorum? Herhangi bir yardım takdir edilecektir. Teşekkür ederim!
path "/app/hello"
Eğer hata ayıklayıcı eklemek için denediniz: –
Yanıt verdiğiniz için teşekkür ederiz (ve soran). Çalıştıktan sonra FAKE.exe dosyasına ekleyebilirim ancak başlatılmadan önce bunu yapamıyorum. Bir istisna tespit edemedim. Günlük çıktısını dahil etmek için soruyu düzenledim. – Jeremy
Başladıktan sonra sürece eklerseniz herhangi bir istisna görüyor musunuz? –