アプリケーションレベルを超えてallowDefinition = 'MachineToApplication'として登録されたセクションを使用するとエラーが発生します。このエラーは、仮想ディレクトリがIISのアプリケーションとして構成されていないために発生します。他のアプリケーションを使用して外部IISサーバーにWCFサービスを公開する
</service>
</services>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
私は、これは非常に一般的かつあいまいなエラーであり、そしてそこにそれについての質問のトンがすでにだが、それらのどれも私の問題を解決していないことを理解しています。だから、私はより完全で具体的にしようとします:
私は外部のIISサーバーにFTP経由で公開しているWCFServiceです。
- プロジェクトです:
<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=*token*" requirePermission="false" /> </configSections> <appSettings> <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> </appSettings> <system.web> <compilation debug="true" targetFramework="4.5.1" /> <httpRuntime targetFramework="4.5.1" /> <customErrors mode="Off"></customErrors> <httpModules> </httpModules> </system.web> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior> <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> </behaviors> <protocolMapping> <add binding="basicHttpsBinding" scheme="https" /> </protocolMapping> <bindings> <basicHttpBinding> <binding name="basicHttpBindingConfiguration"> <security mode="Transport"> <transport clientCredentialType="None" proxyCredentialType="None"/> </security> </binding> </basicHttpBinding> </bindings> <services> <service name="WcfServiceAPI.Services.Validation.ValidationService"> <endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpBindingConfiguration" contract="WcfServiceAPI.Services.Validation.IValidationService"/> </service> <service name="WcfServiceAPI.Services.Jobs.JobsService"> <endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpBindingConfiguration" contract="WcfServiceAPI.Services.Jobs.IJobsService"/> </service> </services> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"> <remove name="ApplicationInsightsWebTracking" /> <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" /> </modules> <directoryBrowse enabled="true" /> <validation validateIntegratedModeConfiguration="false" /> </system.webServer> <entityFramework> <providers> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> </providers> </entityFramework> </configuration>
そして、ここでは、私は確信して作ったものです:私は私のブラウザでサイトを表示しようとすると、私はこれが私の
Web.config
あるhttps://www.domain.com/correctdirectory/JobsService.svcで、このエラーを取得しますcleaned in both Debug and Release mode。
- プロジェクトはデバッグモードでビルドされています。
- IISルートのWeb.configは、このWeb.configと競合しません。基本的にはhttpsを強制し、異なるファイルタイプ要求を処理します。
- サービスは、IIS上のアプリケーション(仮想ディレクトリだけではなく)
私は他のウェブサイトやサービスを持っていない内部ネットワーク上のサーバにそれを公開するときにそれが正常に動作としてホストされています。
公開しようとしているサーバーには他にもたくさんのアプリケーションがありますが、私のアプリケーションはルートレベルにありますので、それは問題ではないでしょうか? 重要な場合は、少なくとも1つのアプリケーションがASMX Webサービスであることもわかります。サーバーの所有者は問題を認識しません。
また、自分のプロジェクトを.NET 4.0にダウングレードしようとしました。なぜなら、彼のASMXサービスが実行されているからです。
アイデア?