我有一个在 IIS 7.5 上运行的 Web 服务
每当我重新启动该 Web 服务正在运行的网站的 IIS 或 AppPool 时,我都会收到以下错误消息。然后我发现,如果我更改编译版本(从 4.5 到 4.0 或从 4.0 到 4.5)并保存 web.config 文件,它就会开始正常工作。这真的很奇怪。任何人都可以帮助我吗?
网络配置:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5"/>
<httpRuntime targetFramework="4.5"/>
</system.web>
<connectionStrings>
<add name="NetDBEntities" connectionString="metadata=res://*/EFatura.csdl|res://*/EFatura.ssdl|res://*/EFatura.msl;provider=System.Data.SqlClient;provider connection string="data source=***********;initial catalog=*****;persist security info=True;user id=sa;password=***************;MultipleActiveResultSets=True;App=NSEfatLib"" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.serviceModel>
<services>
<service name="NSEfatLib.NSEfatEntryPoint">
<endpoint address="Cari" binding="basicHttpBinding" bindingConfiguration=""
name="Cari" contract="NSEfatLib.ICari" />
<endpoint address="Stok" binding="basicHttpBinding" bindingConfiguration=""
name="Stok" contract="NSEfatLib.IStok" />
<endpoint address="FaturaIslemler" binding="basicHttpBinding"
bindingConfiguration="" name="FaturaIslemler" contract="NSEfatLib.IFaturaIslemler" />
<endpoint address="DefterIslemler" binding="basicHttpBinding"
bindingConfiguration="" name="DefterIslemler" contract="NSEfatLib.IDefterIslemler" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https"/>
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
错误信息:
找不到类型“NSEfatLib.NSEfatEntryPoint”,作为 ServiceHost 指令中的服务属性值提供,或在配置元素 system.serviceModel/serviceHostingEnvironment/serviceActivations 中提供。说明:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。
异常详细信息:System.InvalidOperationException:类型“NSEfatLib.NSEfatEntryPoint”,作为 ServiceHost 指令中的服务属性值提供,或在配置元素 system.serviceModel/serviceHostingEnvironment/serviceActivations 中提供。
源错误:
在执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常起源和位置的信息。
堆栈跟踪:
[InvalidOperationException:找不到类型“NSEfatLib.NSEfatEntryPoint”,作为 ServiceHost 指令中的服务属性值提供,或在配置元素 system.serviceModel/serviceHostingEnvironment/serviceActivations 中提供。]
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost (String constructorString, Uri[] baseAddresses) +122516
System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +1451
System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +76
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +901[ServiceActivationException:服务“/Service.svc”由于编译过程中的异常而无法激活。异常消息是:类型“NSEfatLib.NSEfatEntryPoint”,作为 ServiceHost 指令中的服务属性值提供,或在配置元素 system.serviceModel/serviceHostingEnvironment/serviceActivations 中提供,找不到..] System.Runtime.AsyncResult。 End(IAsyncResult 结果) +650220 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult 结果) +210733
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +282
事件日志条目:
System.ServiceModel.ServiceHostingEnvironment+HostingManager/62476613 System.ServiceModel.ServiceActivationException:由于编译期间出现异常,无法激活服务“/Service.svc”。异常消息是:类型'NSEfatLib.NSEfatEntryPoint',作为ServiceHost指令中的Service属性值提供,或在配置元素system.serviceModel/serviceHostingEnvironment/serviceActivations中提供找不到..---> System.InvalidOperationException :找不到类型“NSEfatLib.NSEfatEntryPoint”,作为 ServiceHost 指令中的服务属性值提供,或在配置元素 system.serviceModel/serviceHostingEnvironment/serviceActivations 中提供。在 System.ServiceModel.Activation.ServiceHostFactory。
5028