upgrading from 3.6 to 4.0

upgrading from 3.6 to 4.0

Old forum URL: forums.lhotka.net/forums/t/8875.aspx


theGov posted on Tuesday, May 04, 2010

I have a small app I'm attempting to upgrade from 3.6 to 4.0. For 3.6 this app runs in VS2008 using Cassini, and is configured for using WCF to access the data. I upgraded to VS2010 and using .net 3.5, the app still executed fine. I then changed to .NET 4.0 and CSLA 4.0 dlls. When it attempts to access the data portal it gets the following error. Not sure what is happening since CSLA is in control of the WCF service and proxy, so I'm wondering how the content type would not be consistent.

System.ServiceModel.ProtocolException was unhandled by user code
  Message=The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<html>
    <head>
        <title>Configuration Error</title>
        <style>
         body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
         p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
         b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
         H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
         H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
         pre {font-family:"Lucida Console";font-size: .9em}
         .marker {font-weight: bold; color: black;text-decoration: none;}
         .version {color: gray;}
         .error {margin-bottom: 10px;}
         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
        </style>
    </head>

    <body bgcolor="white">

            <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

            <h2> <i>Configuration Error</i> </h2></sp'.
  Source=mscorlib
  StackTrace:
    Server stack trace:
       at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout)
       at System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Security.CommunicationObjectSecurityTokenProvider.Open(TimeSpan timeout)
       at System.ServiceModel.Security.SymmetricSecurityProtocol.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Channels.SecurityChannelFactory`1.ClientSecurityChannel`1.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout)
       at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.GetTokenCore(TimeSpan timeout)
       at System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(TimeSpan timeout)
       at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Csla.Server.Hosts.IWcfPortal.Fetch(FetchRequest request)
       at Csla.DataPortalClient.WcfProxy.Fetch(Type objectType, Object criteria, DataPortalContext context) in C:\Visual Studio Projects\csla\40\Source\Csla\DataPortalClient\WcfProxy.cs:line 149
       at Csla.DataPortal.Fetch(Type objectType, Object criteria) in C:\Visual Studio Projects\csla\40\Source\Csla\DataPortal.cs:line 238
       at Csla.DataPortal.Fetch[T]() in C:\Visual Studio Projects\csla\40\Source\Csla\DataPortal.cs:line 174
       at CSLATestProjectTracker.BusObj.ProjectType_RdOnlyList.GetProjectType_RdOnlyList() in C:\Users\d006944\Documents\Visual Studio 2010\Projects\CSLATestProjectTracker\CSLATestProjectTrackerBusObj\BusObj\ProjectType_RdOnlyList.cs:line 40
       at FrameWorkApp.StaticListManager.ReadBusObjList[ListType](Int32& cacheRefreshSecs) in C:\Users\d006944\Documents\Visual Studio 2010\Projects\CSLATestProjectTracker\FrameWork\StaticListManager.cs:line 37
       at FrameWorkApp.StaticListManager.GetDefBusObjList[ListType]() in C:\Users\d006944\Documents\Visual Studio 2010\Projects\CSLATestProjectTracker\FrameWork\StaticListManager.cs:line 110
       at FrameWorkApp.StaticListManager.GetBusObjListCurrentItems[ListType]() in C:\Users\d006944\Documents\Visual Studio 2010\Projects\CSLATestProjectTracker\FrameWork\StaticListManager.cs:line 155
       at CSLATestProjectTracker.ProjectList.get_myProjectTypes() in C:\Users\d006944\Documents\Visual Studio 2010\Projects\CSLATestProjectTracker\ProjectList.aspx.cs:line 37
       at CSLATestProjectTracker.ProjectList.Page_Load(Object sender, EventArgs e) in C:\Users\d006944\Documents\Visual Studio 2010\Projects\CSLATestProjectTracker\ProjectList.aspx.cs:line 184
       at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
       at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
       at System.Web.UI.Control.OnLoad(EventArgs e)
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  InnerException: System.Net.WebException
       Message=The remote server returned an error: (500) Internal Server Error.
       Source=System
       StackTrace:
            at System.Net.HttpWebRequest.GetResponse()
            at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       InnerException:

RockfordLhotka replied on Thursday, May 06, 2010

I think the "Server error in '/' Application" is the clue you are looking for. The server app just plain crashed, at the web server level. So there's probably an incompatibility in your web.config from .NET 3.5 to .NET 4.

Copyright (c) Marimer LLC