Wednesday, March 21, 2012

WCF problem with June CTP on WinFX Beta 2

The documentation states that "The WCF support in this version of "Atlas" requires Beta 2 of .NET Framework version 3.0."

Unfortunately, when I run the wcf_cs/Simple.aspx from the Atlas Documentation website (run as a filesystem) on Beta 2 (on XP SP2), I get the following stack trace:

[InvalidCastException: Unable to cast object of type 'System.Web.Compilation.BuildResultCustomString' to type 'System.Web.Util.ITypedWebObjectFactory'.] System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +161 System.Web.Compilation.BuildManager.GetCompiledType(VirtualPath virtualPath) +36 System.Web.Compilation.BuildManager.GetCompiledType(String virtualPath) +81 Microsoft.Web.Services.WebServiceData.GetWebServiceData(String virtualPath, Boolean failIfNoData) +271 Microsoft.Web.Services.WebServiceData.GetWebServiceData(String virtualPath) +30 Microsoft.Web.UI.ScriptManager.BuildScriptElement(String servicePath) +399 Microsoft.Web.UI.ScriptManager.GetScriptReferences() +979 Microsoft.Web.UI.ScriptManager.RenderXmlScript(TextWriter writer) +110 Microsoft.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) +663 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +96 System.Web.UI.Page.PerformPreRenderComplete() +32 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4796

Is there anyway to fix or workaround the above problem? Is there a configuration in which WCF will work with ATLAS?

Thanks, Jack

I was able to get the simple service WCF sample to work by pulling the relevant files out into a newly created Atlas enabled test website. I then quickly discovered that navigating (instead of trying to directly view or set simple.aspx as the start page in VS) to the simple service form in the Atlas Documentation website also worked. I'm not sure why -- I nested the service files in my test website and was still able to view it directly. As time permits, I'll see if I can find a cause.

At any rate, WCF appears (I've only tried the samles) to work with the June CTP of Atlas on WinFX Beta 2.

No comments:

Post a Comment