也许你可以帮助我,因为我在这里真的很茫然。托管WCF时发生服务器错误
我想在子域上的IIS上托管我的WCF服务。
开始,这里是我的文件结构:
http://s18.postimage.org/eqmjxb00n/Serv.jpg
垃圾桶里面是代表我的界面我.dll和它的实现。
这里是web.config文件:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="false" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service name="AuthenticatorService.Authenticator">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration=""
name="AuthEndpoint" contract="AuthInterface.IAuthenticator" />
<endpoint address="" binding="mexHttpBinding" name="MetadataEndpoint"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
它本地工作,但是当我上传到IIS它只是给500服务器错误。
谢谢!
如果它在这里的任何使用是从详细的错误页面的消息:
Module ServiceModel-4.0
Notification AuthenticateRequest
Handler svc-Integrated-4.0
Error Code 0x00000000
Requested URL http://service.swiftposter.com:80/auth.svc
Logon Method Anonymous
Logon User Anonymous
编辑:我启用ELMAH记录和终于拿到了meaningfull消息:
System.ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'. Parameter name: item
我就要开始研究这个错误,但我在这里发布,以防万一有人知道什么是错的。
堆栈跟踪:
System.ServiceModel.ServiceActivationException: The service '/auth.svc' cannot be activated due to an exception during compilation. The exception message is: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.
Parameter name: item. ---> System.ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.
Parameter name: item
at System.ServiceModel.UriSchemeKeyedCollection.InsertItem(Int32 index, Uri item)
at System.Collections.Generic.SynchronizedCollection`1.Add(T item)
at System.ServiceModel.UriSchemeKeyedCollection..ctor(Uri[] addresses)
at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses)
at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses)
at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
--- End of inner exception stack trace ---
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)
at System.ServiceModel.Activation.ServiceHttpModule.EndProcessRequest(IAsyncResult ar)
at System.Web.HttpApplication.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar)
在IIS中部署时没有任何反应?你在问题标题中提到了500个服务器错误。你能告诉我们更多一点吗? – 2012-03-30 10:14:50
对不起,没有任何反应,我的意思是它没有运行。它只是不断给我500服务器错误。 – TheGateKeeper 2012-03-30 10:17:33
是。净版本的应用程序池定义的权限是文件/数据库使用正确的凭据发布(如果适用)。问题可能是问题。你有更多的信息吗? – 2012-03-30 10:30:15