Adding Host to resourceSets gives XmlSchemaException

Jan 10, 2012 at 8:33 PM
Edited Jan 11, 2012 at 5:45 PM

Hello,

I'm trying to add a host to the ResourceSets in combres.xml.  When I add any text it throws the exception below.

I'm trying to add a host to route my static content (css and js) through amazon's CloudFront service (basically a proxy server).

Any help is appreciated.
Thanks,
Jeff

 

Here's what I'm trying to set in combres.xml:


  <resourceSets url="~/combres.axd"
                host="static.mysite.com"
                defaultDuration="365"
                defaultVersion="auto"
                defaultDebugEnabled="false"
                defaultIgnorePipelineWhenDebug="true"
                localChangeMonitorInterval="30"
                remoteChangeMonitorInterval="60"
                > 


No matter what I set host to I get this exception:

Stack Trace:  

[XmlSchemaException: The Pattern constraint failed.]

[XmlSchemaValidationException: The 'host' attribute is invalid - The value 'static.mysite.com' is invalid according to its datatype 'String' - The Pattern constraint failed.]
   Combres.XLinqExtensions.<Validate>b__0(Object sender, ValidationEventArgs e) +7
   System.Xml.Schema.XNodeValidator.ValidationCallback(Object sender, ValidationEventArgs e) +28
   System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(XmlSchemaValidationException e, XmlSeverityType severity) +91
   System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(String code, String[] args, Exception innerException) +85
   System.Xml.Schema.XmlSchemaValidator.CheckAttributeValue(Object value, SchemaAttDef attdef) +4024967
   System.Xml.Schema.XmlSchemaValidator.ValidateAttribute(String lName, String ns, XmlValueGetter attributeValueGetter, String attributeStringValue, XmlSchemaInfo schemaInfo) +4024832
   System.Xml.Schema.XmlSchemaValidator.ValidateAttribute(String localName, String namespaceUri, String attributeValue, XmlSchemaInfo schemaInfo) +28
   System.Xml.Schema.XNodeValidator.ValidateAttribute(XAttribute a) +87
   System.Xml.Schema.XNodeValidator.ValidateAttributes(XElement e) +69
   System.Xml.Schema.XNodeValidator.ValidateElement(XElement e) +132
   System.Xml.Schema.XNodeValidator.ValidateNodes(XElement e) +56
   System.Xml.Schema.XNodeValidator.ValidateElement(XElement e) +154
   System.Xml.Schema.XNodeValidator.Validate(XObject source, XmlSchemaObject partialValidationType, Boolean addSchemaInfo) +457
   System.Xml.Schema.Extensions.Validate(XDocument source, XmlSchemaSet schemas, ValidationEventHandler validationEventHandler, Boolean addSchemaInfo) +65
   Combres.XLinqExtensions.Validate(XDocument xdoc, String nameSpace, XmlReader[] schemaReaders) +164
   Combres.ConfigReader.LoadAndValidate(String filePath) +109
   Combres.Configuration.ReloadSettings() +213
   Combres.Configuration.ApplyChanges() +209
   Combres.Configuration.GetSettings() +24
   Combres.WebExtensions.GetResourceSet(String setName) +12
   Combres.WebExtensions.CombresLink(String setName, Object htmlAttributes) +37
   Combres.Mvc.MvcExtensions.CombresLink(HtmlHelper html, String setName) +14
   ASP._Page_Views_Account_LogOn_cshtml.Execute() in c:\APPLICATIONPATH\Views\Account\LogOn.cshtml:13
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +207
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +81
   System.Web.WebPages.StartPage.RunPage() +19
   System.Web.WebPages.StartPage.ExecutePageHierarchy() +65
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +76
   System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +220
   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +303
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +23
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +177
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
   System.Web.Mvc.Controller.ExecuteCore() +116
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8963149
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
Coordinator
Jan 12, 2012 at 7:04 AM

You need to append the protocol, e.g. http://static.mysite.com

Jan 12, 2012 at 2:58 PM

Wow, my bad.  I should've known that.  Works like a charm.

Thanks!