3

ServiceStack (3.9.37) のチュートリアルに従い、空の ASP.Net Web アプリケーションを作成し、Web サービスをここで期待どおりに動作させました。

http://www.somedomain.com:53032/api/metadata

Swagger-UI Package (3.9.35) にもリンクしました

Plugins.Add(new SwaggerFeature()); を追加しました。AppHost.Config 内

私の問題は、ここで期待するように Swagger-UI が利用できないことです。

http://www.somedomain.com:53032/swagger-ui/index.html

スタック トレースで「Handler for Request not found:」というエラーが表示されます。

ターゲット フレームワーク 4.0 と 4.5 を試しましたが、同じ結果が得られました。Visual Studio のバージョンは 2012 です

このリンクを正しく取得するために見逃したものはありますか?

4

1 に答える 1

3

それがパスの問題であることがわかりました。web.configに次の変更を加えることで解決しました。

//Added Location node
//path moved here
<location path="api">  // Path moved to location area !!!

<system.web>
<compilation debug="true" targetFramework="4.5"/>
<httpRuntime/>
<httpHandlers>

//Path returned to wildcard
<add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/>

</httpHandlers>
<pages controlRenderingCompatibilityVersion="4.0"/>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<add path="*" name="ServiceStack.Factory" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true"/>
</handlers>
</system.webServer>
</location>
于 2013-02-20T06:29:59.747 に答える