0

コンソール アプリケーションで NLog を正しく動作させることができないようです。Windows 8 マシンで VS 2012 を実行しています。プロジェクトで 4.0 Framework を使用するようにしました。

フィドラーを使用すると、ターゲットにメッセージを送信しようとしていることがわかりますが、リクエストにはヘッダー情報しか含まれていません。SOAP エンベロープはありません。パラメータに基づいて SOAP メッセージを生成する必要がありますが、そうではありません。

私もプログラムでこれを試しましたが、それもうまくいきません。

これが私の設定です:

    <configSections>
    <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
  </configSections>
  <nlog internalLogLevel="Trace" throwExceptions="true" autoReload="true" internalLogFile="C:\TestDocs\Fail.txt" xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <targets>
      <target name="ws" xsi:type="WebService" protocol="Soap11" namespace="http://tempuri.org/" url="http://xxxxxx.com/Services/LogService.asmx" methodName="WriteLog">
                  <parameter name="appDate" layout="${date}" type="System.String"/>
          <parameter name="msg" layout="${message}" type="System.String"/>        
      </target>
    </targets>
    <rules>
      <logger name="*" writeTo="ws" />
    </rules>
  </nlog>

何か案は?

4

1 に答える 1

0

バージョン NLog 1.0 Refresh までさかのぼって動作させることができました。私はまだ 4.0 フレームワークを使用していますが、動作します。最新バージョンでそれを実行する方法はまだ説明されていません。

于 2013-03-29T17:02:45.273 に答える