我在IIS中的网站内创建了一个应用程序。无法停止web.config继承
我的应用程序有没有举办一个WCF服务端点上运行.NET 4.0的代码(它被创建在被运行.NET 2.0的网站)
当我加载该服务端点,我得到一个错误的模型并且缺少处理程序(因为根网站在web.config中定义了它们)。
我试着包装我的System.Web以及system.serviceModel在以下指令:
<location path="." inheritInChildApplications="false">
<system.web>
...
</location>
但处理器和模块继续尝试加载。
接下来,我尝试清除模块和处理程序。
<httpModules>
<clear />
</httpModules>
<httpHandlers>
<clear />
</httpHandlers>
这导致了以下错误:
No http handler was found for request type 'GET'
下一个我试图手动添加只将必要的处理程序.SVC
<add
verb="*"
path="*.svc"
type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
这导致:
Could not load type 'System.ServiceModel.Activation.HttpHandler' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
在IIS中,我的appl设置为.Net 4.0。我没有看到直接在应用程序池上指定框架的方式(它只有回收,性能,健康,标识选项卡)。
我需要做的是在2.0网站中添加运行.net 4.0的虚拟目录/应用程序,并托管一个WCF端点。
我的4.0应用程序正在单独的应用程序池下运行。
加入整个的web.config
<?xml version="1.0"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.web>
<compilation debug="true" />
<authentication mode="Windows" />
<httpModules>
<clear />
</httpModules>
<httpHandlers>
<clear />
<add verb="*" path="*.svc"
type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</httpHandlers>
</system.web>
<system.serviceModel>
<bindings>
<!--<basicHttpBinding>
<binding name="extAcctCustMapBinding" maxBufferSize="1000000"
maxReceivedMessageSize="1000000" />
</basicHttpBinding>-->
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="DebugBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="DebugBehavior" name="MyService">
<endpoint binding="basicHttpBinding" name="MyService"
contract="IMyService" />
</service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="false"/>
</system.webServer>
</location>
</configuration>
嗯..至少IIS不阻止我创建它..所以我想我可以使它工作?我的意思是,如果我使用不同的应用程序池? –
我看到你的编辑。您对IIS使用集成或经典模式吗? –