Sitefinity 4.0 Beta: Deploying projects to ISPs

Posted by Community Admin on 03-Aug-2018 20:11

Sitefinity 4.0 Beta: Deploying projects to ISPs

All Replies

Posted by Community Admin on 31-Aug-2010 00:00

I deployed a SF 4.0 Beta project to my isp.

1) Deployed the db. Worked fine.
2) Depoyed the web site files
3) Edited the data config file and changed the connection string.

Now, i can hit the SF site fine. Its just one page: http://www.partnerrock.com/

But if i hit the SF admin area, i run into a problem. The dashboard comes up fine, but clicking the Pages option returns this error:
Message from webpage: This collection already contains an address with schemd http.&nbsp: There can be at most one address per scheme in this collection. <br>parameter name: item

This occurs each time i click the Pages tab. Other tabs seem to work fine.

Ken

Posted by Community Admin on 31-Aug-2010 00:00

Hey Ken,


I'm having the same problem but I think I found a workaround.  This error is stemming from running WCF services from a site with multiple bindings in IIS (multiple host headers per site).  This IIS configuration is very common and I guess this is the intended design of WCF services my Microsoft.

My workaround is:

using System;
using System.Collections.Generic;
using System.Web;
using System.ServiceModel;
using System.Configuration;
 
namespace MySite.Web.Services
    public class WcfHostFactory : Telerik.Sitefinity.Web.Services.WcfHostFactory
    
        public WcfHostFactory()
            : base()
        
 
        
 
        protected override ServiceHost CreateServiceHost(Type type, Uri[] uri)
        
            string baseServiceHost = ConfigurationManager.AppSettings["baseServiceHost"];
            IDictionary<string, int> schemes = new Dictionary<string, int>();
            List<Uri> clean = new List<Uri>();
            for (int i = 0; i < uri.Length; i++)
            
                try
                
                    if (uri[i].Host == baseServiceHost)
                    
                        schemes.Add(uri[i].Scheme, i);
                        clean.Add(uri[i]);
                    
                
                catch (ArgumentException)
                
            
            return base.CreateServiceHost(type, clean.ToArray());
        
    

There's probably a more graceful way to do it but this was my first pass at it.

Then I replace the Telerik WcfHostFactory with my wrapper in the PagesService.svc file:

<%@ ServiceHost Language="C#" Debug="true" Service="Telerik.Sitefinity.Modules.Pages.Web.Services.PagesService" Factory="MySite.Web.Services.WcfHostFactory" %>

Add an appSettings key to your web.config:

<add key="baseServiceHost" value="www.partnerrock.com"/>

And it should work.  Of course, you will have to find and replace all instances of Telerik.Sitefinity.Web.Services.WcfHostFactory in your .svc files.  that's my next step.

Cheers!
Bryan

Posted by Community Admin on 01-Sep-2010 00:00

Hi Bryan,

Thank you for providing the workaround. We are going to resolve this issue by providing the ability to set default bindings for services.

Greetings,
Radoslav Georgiev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 02-Sep-2010 00:00

Did you try setting the baseAddressPrefixFilters element in your web.config?

<system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true">
        <baseAddressPrefixFilters>
            <add prefix="http://www.partnerrock.com/" />
        </baseAddressPrefixFilters>
    </serviceHostingEnvironment>
<system.serviceModel>

Here is Microsoft's documentation regarding multiple IIS bindings, http://msdn.microsoft.com/en-us/library/aa751841.aspx.

Edit: It looks like this solution currently doesn't work and has been logged in the teams bug list. See forum thread.

This thread is closed