问题
I configure TFS2012 team build. During the configuration the build service showed status running and little later (may be 10seconds) build controller and build agent service get stopped. But in manage build controller window, my TFS2012 controller and agent shows available.
So i triggered a build definition configured for this controller, even after 5 mins in shows "Running for 0 Seconds" and waiting in queue.
In event viewer log i could see the below error logged:
WebHost failed to process a request. Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/39086322 Exception: System.ServiceModel.ServiceActivationException: The service '/tfs/queue//Services/v4.0/MessageQueueService2.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, EventTraceActivity eventTraceActivity) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) --- End of inner exception stack trace --- at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath, EventTraceActivity eventTraceActivity) Process Name: w3wp Process ID: 6104 Thanks in advance.
回答1:
Exactly as the exception suggests, it sounds like you have two http bindings for the tfs web service.
Two options:
Go into the web.config and remove one of the http bindings.
Do what it suggests in the exception and allow multiple site bindings
Updated to contain users solution
Added the below tag in web.config file under "C:\Program Files\Microsoft Team Foundation Server 11.0\Application Tier\Web Services"
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="True">
</serviceHostingEnvironment>
</system.serviceModel>
回答2:
Since i have configure a FQDN for external access:
Added the below tag in web.config file under "C:\Program Files\Microsoft Team Foundation Server 11.0\Application Tier\Web Services"
</serviceHostingEnvironment>
来源:https://stackoverflow.com/questions/15378001/tfs2012-build-service-offline