How to dispose these objects? - sharepoint-2010

The project I'm maintaining has a bunch of usercontrols where SPWeb and SPSite objects are initialized in the constructor from SPContext. These objects are then passed to other classes.
public MyUserControl : UserControl
{
private SPWeb web;
public MyUserControl() { web = SPContext.Current.Web; }
AnotherClass.SomeMethod ( web );
}
The logs are filled with the following two entries:
1)
Detected use of SPRequest for previously closed SPWeb object. Please close SPWeb objects when you are done with all objects obtained from them, but not before. Stack trace:
at Microsoft.SharePoint.SPListItemCollection.EnsureListItemsData()
at Microsoft.SharePoint.SPListItemCollection.GetEnumerator()
at XXXXXXXX.Web.UserControls.TopNavigation.LoadTopImage()
at XXXXXXXX.Web.UserControls.TopNavigation.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
2)
An SPRequest object was not disposed before the end of this thread. To avoid wasting system resources, dispose of this object or its parent (such as an SPSite or SPWeb) as soon as you are done using it. This object will now be disposed. Allocation Id: {444DCCA1-C2F6-493D-9D02-D04F75C6E384} This SPRequest was allocated
at
at Microsoft.SharePoint.Library.SPRequest..ctor()
at Microsoft.SharePoint.SPGlobal.CreateSPRequestAndSetIdentity(SPSite site, String name, Boolean bNotGlobalAdminCode, String strUrl, Boolean bNotAddToContext, Byte[] UserToken, String userName, Boolean bIgnoreTokenTimeout, Boolean bAsAnonymous)
at Microsoft.SharePoint.SPWeb.InitializeSPRequest()
at Microsoft.SharePoint.SPWeb.InitWebPublic()
at Microsoft.SharePoint.SPWeb.get_LanguageCulture()
at Microsoft.SharePoint.SPWeb.get_Title()
at XXXXXXXXX.DataAccessUtility.<>c__DisplayClassc.<GetSitesTopNav>b__8()
at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass4.<RunWithElevatedPrivileges>b__2()
at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
at XXXXXXXX.GetSitesTopNav(SPSite site, SPWeb Currentweb, String userName)
at XXXXXXXX.Web.UserControls.TopNavigation.PopulateSiteSelection()
at XXXXXXXX.Web.UserControls.TopNavigation.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
Is passing the url obtained from SPContext.Current.Web.Url the right way? Any suggestions?

Related

Error changing the language in Sitefinity

we have a website with 4 languages. the standard language and english. but not everyone else. Here comes the following error:
[NullReferenceException: Object reference not set to an instance of an object.]
Telerik.Sitefinity.Frontend.Resources.PackageManager.GetPackageFromNodeId(String nodeId) +400
Telerik.Sitefinity.Frontend.Resources.PackageManager.GetPackageFromPageInfo() +742
Telerik.Sitefinity.Frontend.Resources.PackageManager.GetCurrentPackage() +100
Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Controllers.ControllerExtensions.GetKey(Controller controller) +320
Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Controllers.ControllerExtensions.GetViewEngineCollection(Controller controller, Func`1 pathTransformationsFunc) +42
Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Controllers.ControllerExtensions.UpdateViewEnginesCollection(Controller controller, Func`1 pathTransformationsFunc) +25
Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Layouts.LayoutRenderer.CreateController(RouteData routeData) +333
Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Layouts.LayoutRenderer.GetLayoutTemplate(String templateName, Boolean placeholdersOnly) +30
Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Layouts.LayoutVirtualFileResolver.Open(PathDefinition definition, String virtualPath) +155
Telerik.Sitefinity.Abstractions.VirtualPath.PageResolverBase.BuildWithMasterPage(String virtualPath, RequestContext context, StringBuilder output, CursorCollection placeHolders, DirectiveCollection directives) +77
Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Layouts.<>c__DisplayClass2.<BuildWithMasterPage>b__0(Object[] args) +237
Telerik.Sitefinity.Services.SystemManager.RunWithElevatedPrivilege(RunWithElevatedPrivilegeDelegate delegateToRun, Object[] parameters, String urlRequest) +439
Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Layouts.LayoutMvcPageResolver.BuildWithMasterPage(String virtualPath, RequestContext context, StringBuilder output, CursorCollection placeHolders, DirectiveCollection directives) +234
Telerik.Sitefinity.Mvc.Rendering.PureMvcPageResolver.RenderPage(StringBuilder sb, PageData pageData, RequestContext context, String virtualPath) +424
Telerik.Sitefinity.Mvc.Rendering.PureMvcPageResolver.Open(PathDefinition definition, String virtualPath) +1084
System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) +235
System.Web.UI.TemplateParser.ParseInternal() +107
System.Web.UI.TemplateParser.Parse() +195
System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() +173
System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) +132
System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() +218
System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +30
System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +495
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +343
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +142
System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) +11902614
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +47
Telerik.Sitefinity.Web.Compilation.CompilationHelpers.LoadControl(String virtualPath, Boolean isCausedByUserInteraction, PageSiteNode pageSiteNode) +364
Telerik.Sitefinity.Web.PageRouteHandler.InstantiateHandler(RequestContext requestContext, PageSiteNode pageDataNode, String& theme) +220
Telerik.Sitefinity.Web.PageRouteHandler.BuildHttpHandler(RequestContext requestContext) +683
Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Routing.MvcPageRouteHandler.BuildHttpHandler(RequestContext requestContext) +10
System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context) +11995005
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +88
What could be the reason?
Greetings Andreas

Unable To Cast Object error when trying to populate ObjectListView control

I have downloaded the ObjectListView.dll and added it as a reference into my VB.NET application. I have added it to my toolbox and added an ObjectListView control to my form. However, when I try and populate it, I get the following error:
Unable to cast object of type 'System.Windows.Forms.ListViewItem' to
type 'BrightIdeasSoftware.OLVListItem'
My code snippet looks like so:
lsvOverdueCalls.Items.Add(tempDT.Rows(0)("id").ToString)
lsvOverdueCalls.Items(0).SubItems.Add(tempDT.Rows(0)("summary").ToString)
lsvOverdueCalls.Items(0).SubItems.Add(tempDT.Rows(0)("first_name").ToString)
Unsure if I'm doing something wrong. My applicaton is compiled under the full version of dot.net 4.5, not the client version as advised.
Any help appreciated.
Update
I noticed I get the following error in my debugger window but ONLY when moving the mouse over a ListViewItem:
A first chance exception of type 'System.InvalidCastException'
occurred in ObjectListView.dll System.Transactions Critical: 0 :
http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/UnhandledUnhandled
exceptionDrakeMon2.0.vshost.exeSystem.InvalidCastException,
mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089Unable to cast
object of type 'System.Windows.Forms.ListViewItem' to type
'BrightIdeasSoftware.OLVListItem'. at
BrightIdeasSoftware.ObjectListView.GetItem(Int32 index) at
BrightIdeasSoftware.ObjectListView.LowLevelHitTest(Int32 x, Int32 y)
at BrightIdeasSoftware.ObjectListView.OlvHitTest(Int32 x, Int32 y)
at BrightIdeasSoftware.ObjectListView.BuildCellEvent(CellEventArgs
args, Point location) at
BrightIdeasSoftware.ObjectListView.OnMouseMove(MouseEventArgs e) at
System.Windows.Forms.Control.WmMouseMove(Message& m) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ListView.WndProc(Message& m) at
BrightIdeasSoftware.ObjectListView.WndProc(Message& m) at
System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg) at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr
dwComponentID, Int32 reason, Int32 pvLoopData) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at
DrakeMon2.frmNewDashboard.ToolStripMenuItem2_Click(Object sender,
EventArgs e) in C:\Dropbox\VS Projects\DrakeMon v2.0\DrakeMon
v2.0\frmNewDashboard.vb:line 986 at
System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e) at
System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at
System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at
System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m,
MouseButtons button, Int32 clicks) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ToolStrip.WndProc(Message& m) at
System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg) at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr
dwComponentID, Int32 reason, Int32 pvLoopData) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context) at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[]
commandLine) at DrakeMon2.My.MyApplication.Main(String[] Args) in
17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at
System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[]
args) at
System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext
activationContext, String[] activationCustomData) at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx) at
System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx) at
System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) at
System.Threading.ThreadHelper.ThreadStart()System.InvalidCastException:
Unable to cast object of type 'System.Windows.Forms.ListViewItem' to
type 'BrightIdeasSoftware.OLVListItem'. at
BrightIdeasSoftware.ObjectListView.GetItem(Int32 index) at
BrightIdeasSoftware.ObjectListView.LowLevelHitTest(Int32 x, Int32 y)
at BrightIdeasSoftware.ObjectListView.OlvHitTest(Int32 x, Int32 y)
at BrightIdeasSoftware.ObjectListView.BuildCellEvent(CellEventArgs
args, Point location) at
BrightIdeasSoftware.ObjectListView.OnMouseMove(MouseEventArgs e) at
System.Windows.Forms.Control.WmMouseMove(Message& m) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ListView.WndProc(Message& m) at
BrightIdeasSoftware.ObjectListView.WndProc(Message& m) at
System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg) at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr
dwComponentID, Int32 reason, Int32 pvLoopData) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at
DrakeMon2.frmNewDashboard.ToolStripMenuItem2_Click(Object sender,
EventArgs e) in C:\Dropbox\VS Projects\DrakeMon v2.0\DrakeMon
v2.0\frmNewDashboard.vb:line 986 at
System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e) at
System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at
System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at
System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m,
MouseButtons button, Int32 clicks) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ToolStrip.WndProc(Message& m) at
System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg) at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr
dwComponentID, Int32 reason, Int32 pvLoopData) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context) at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[]
commandLine) at DrakeMon2.My.MyApplication.Main(String[] Args) in
17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at
System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[]
args) at
System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext
activationContext, String[] activationCustomData) at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx) at
System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx) at
System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) at
System.Threading.ThreadHelper.ThreadStart()
I'm assuming a threading issue, but I'm unsure why this control throws an error and a normal listview or even the BetterListView control doesn't. My form only contains this control and nothing else. And...like mentioned, it ONLY occurs if I try and move the mouse over a ListViewItem.
Thanks
You cannot do Add() on the ObjectListView like you do on a normal ListView. Instead, you need to call the SetObjects method on the ObjectListView instance, and pass it a list of items to add.
So in your case, create a List<Call> of the items to add (assuming your model is a Call class with id, summary and first_name fields, and then pass it on to the lsvOverdueCalls.SetObjects() like so.
var lstCalls = new List<Call>()
{
new Call() {
Id = tempDT.Rows(0)("id").ToString,
Summary = tempDT.Rows(0)("summary").ToString,
First_Name = tempDT.Rows(0)("first_name").ToString
}
};
lsvOverdueCalls.SetObjects(lstCalls);
And here's how your Call model should look like.
public class Call
{
public string Id { get; set; }
public string Summary { get; set; }
public string First_Name { get; set; }
}

WCF-Exception while returning List<T>

in my following application, i generate a List of the class 'JobManager'.
List<JobManager>
The access to the database and filling my list is working perfect. It seems there is a problem for returning such list to my client.
In detail,my code looks like this
IService Class
OperationContract(Name = "ReadJobQueue")]
[FaultContract(typeof(FaultException))]
List<JobManager> AccessManager(List<string> status,string process, string dtFrom, string dtTo);
Service : IService
public List<JobManager> AccessManager(List<string> status, string process, string dtFrom, string dtTo)
{
//return 'new List<JobManager>()' does work, without any data being filled.
return new JobBuilder(status, process, dtFrom, dtTo);
}
[DataContract]
public class JobManager
{
List<JobManager> _jobManagerchildren = new List<JobManager>();
[DataMember(IsRequired = true, Order = 0)]
public string Description { get; set; }
[DataMember]
public List<JobManager> JobManagerChildren
{
get { return _jobManagerchildren; }
internal set { _jobManagerchildren = value; }
}
}
internal class JobBuilder : List<JobManager>
{
public JobBuilder(List<string> status, string process, string dtFrom, string dtTo)
: base()
{
DataTable dt = new Database().AccessJobQueue(status, process, dtFrom, dtTo);
foreach (DataRow row in dt.Rows)
{
Add(new JobManager { Description = row[1].ToString(), JobManagerChildren = JobDetail(row[0].ToString()) });
}
}
...
}
Have i missed something for my JobManager class?
edit error code / exception
System.Net.Sockets.SocketException:
An existing connection was been closed by the remotehost
bei System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size
, SocketFlags socketFlags)
bei System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int
32 offset, Int32 size, TimeSpan timeout, Boolean closing)
--- Ende der internen Ausnahmestapelüberwachung ---
bei System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int
32 offset, Int32 size, TimeSpan timeout, Boolean closing)
bei System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 o
ffset, Int32 size, TimeSpan timeout)
bei System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int
32 offset, Int32 size, TimeSpan timeout)
bei System.ServiceModel.Channels.ConnectionStream.Read(Byte[] buffer, Int32 o
ffset, Int32 count)
bei System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32
count)
bei System.Net.Security.NegotiateStream.StartFrameHeader(Byte[] buffer, Int32
offset, Int32 count, AsyncProtocolRequest asyncRequest)
bei System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offs
et, Int32 count, AsyncProtocolRequest asyncRequest)
--- Ende der internen Ausnahmestapelüberwachung ---
bei System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offs
et, Int32 count, AsyncProtocolRequest asyncRequest)
bei System.Net.Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int
32 count)
bei System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 o
ffset, Int32 size, TimeSpan timeout)
--- Ende der internen Ausnahmestapelüberwachung ---
Server stack trace:
bei System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 o
ffset, Int32 size, TimeSpan timeout)
bei System.ServiceModel.Channels.SessionConnectionReader.Receive(TimeSpan tim
eout)
bei System.ServiceModel.Channels.SynchronizedMessageSource.Receive(TimeSpan t
imeout)
bei System.ServiceModel.Channels.FramingDuplexSessionChannel.Receive(TimeSpan
timeout)
bei System.ServiceModel.Channels.FramingDuplexSessionChannel.TryReceive(TimeS
pan timeout, Message& message)
bei System.ServiceModel.Dispatcher.DuplexChannelBinder.Request(Message messag
e, TimeSpan timeout)
bei System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean o
neway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan ti
meout)
bei System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCal
lMessage methodCall, ProxyOperationRuntime operation)
bei System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage re
qMsg, IMessage retMsg)
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgD
ata, Int32 type)
bei WcfSys.Shared.IService.AccessManager(List`1 status, String process, S
tring dtFrom, String dtTo)
bei WcfSys.Server.Program.Main() in WcfSys.Ser
ver\Program.cs:Zeile 66.
Actually, what you're sending back to the client is a List<JobManager>, but actually it's a derived class. So there are two ways of fixing this:
Copy all entries from JobBuilder to a new List<JobManager> and return that new list
Make JobBuilder a DataContract, too.
As - by OOP principles - it is know that the object you're returning is a JobBuilder, the runtime tries to serialize the JobBuilder instance. This, however, is not a know type for WCF communication.

Invalid value for key 'attachdbfilename' on WebSecurity.InitializeDatabaseConnection

I get this error message when trying to initialize my database connection using SimpleMembership. The first initialize statement goes through, while the second does not. The goal is to use connection strings defined in the Azure service configuration when running Azure emulator or when deployed.
Web.config:
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-**********;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-**********.mdf" providerName="System.Data.SqlClient" />
</connectionStrings>
Azure .cscfg configuration files:
<Setting name="SqlConnectionString" value="Server=Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-********;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-********.mdf" />
SimpleMembershipInitializer:
string connectionStringName = "DefaultConnection";
string connectionString = CloudConfigurationManager.GetSetting("SqlConnectionString");
const string userTableName = "UserProfile";
const string providerName = "System.Data.SqlClient";
const string userIdColumn = "UserId";
const string userNameColumn = "UserName";
// This works fine.
// WebSecurity.InitializeDatabaseConnection(connectionStringName, userTableName, userIdColumn, userNameColumn, autoCreateTables: true);
// This throws exception.
// WebSecurity.InitializeDatabaseConnection(connectionString, providerName, userTableName, userIdColumn, userNameColumn, autoCreateTables: true);
Environment: Visual Studio 2012, EntityFramework 5.0 and MVC4 RTM with default SimpleMembership structure.
Full stacktrace:
[ArgumentException: Invalid value for key 'attachdbfilename'.]
System.Data.SqlClient.SqlConnectionString.VerifyLocalHostAndFixup(String& host, Boolean enforceLocalHost, Boolean fixup) +888986
System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +5330002
System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +24
System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +167
System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key) +61
System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +66
WebMatrix.Data.DbProviderFactoryWrapper.CreateConnection(String connectionString) +96
WebMatrix.Data.<>c__DisplayClass15.<OpenConnectionStringInternal>b__14() +16
WebMatrix.Data.Database.get_Connection() +19
WebMatrix.Data.Database.EnsureConnectionOpen() +12
WebMatrix.Data.<QueryInternal>d__0.MoveNext() +66
System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source) +164
WebMatrix.Data.Database.QuerySingle(String commandText, Object[] args) +103
WebMatrix.WebData.DatabaseWrapper.QuerySingle(String commandText, Object[] parameters) +14
WebMatrix.WebData.SimpleMembershipProvider.CheckTableExists(IDatabase db, String tableName) +57
WebMatrix.WebData.SimpleMembershipProvider.CreateTablesIfNeeded() +49
WebMatrix.WebData.WebSecurity.InitializeMembershipProvider(SimpleMembershipProvider simpleMembership, DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean createTables) +73
WebMatrix.WebData.WebSecurity.InitializeProviders(DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables) +51
WebMatrix.WebData.WebSecurity.InitializeDatabaseConnection(String connectionString, String providerName, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables) +63
MyProject.Filters.SimpleMembershipInitializer..ctor() in c:\Repos\MyRepo\trunk\Web\MyProject\Filters\InitializeSimpleMembershipAttribute.cs:55
[InvalidOperationException: The ASP.NET Simple Membership database could not be initialized. For more information, please see http://go.microsoft.com/fwlink/?LinkId=256588]
MyProject.Filters.SimpleMembershipInitializer..ctor() in c:\Repos\MyRepo\trunk\Web\MyProject\Filters\InitializeSimpleMembershipAttribute.cs:59
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +113
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +232
System.Activator.CreateInstance(Type type, Boolean nonPublic) +83
System.Activator.CreateInstance(Type type) +6
System.Threading.LazyHelpers`1.ActivatorFactorySelector() +68
System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +115
System.Threading.LazyInitializer.EnsureInitialized(T& target, Boolean& initialized, Object& syncLock) +106
MyProject.Filters.InitializeSimpleMembershipAttribute.OnActionExecuting(ActionExecutingContext filterContext) in c:\Repos\MyRepo\trunk\Web\MyProject\Filters\InitializeSimpleMembershipAttribute.cs:23
System.Web.Mvc.Async.AsyncControllerActionInvoker.InvokeActionMethodFilterAsynchronously(IActionFilter filter, ActionExecutingContext preContext, Func`1 nextInChain) +69
System.Web.Mvc.Async.<>c__DisplayClass3b.<BeginInvokeActionMethodWithFilters>b__35() +21
System.Web.Mvc.Async.AsyncControllerActionInvoker.InvokeActionMethodFilterAsynchronously(IActionFilter filter, ActionExecutingContext preContext, Func`1 nextInChain) +489
System.Web.Mvc.Async.<>c__DisplayClass3b.<BeginInvokeActionMethodWithFilters>b__35() +21
System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__31(AsyncCallback asyncCallback, Object asyncState) +191
System.Web.Mvc.Async.WrappedAsyncResult`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +130
System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters, AsyncCallback callback, Object state) +197
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__1e(AsyncCallback asyncCallback, Object asyncState) +446
System.Web.Mvc.Async.WrappedAsyncResult`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +130
System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeAction(ControllerContext controllerContext, String actionName, AsyncCallback callback, Object state) +302
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__17(AsyncCallback asyncCallback, Object asyncState) +30
System.Web.Mvc.Async.WrappedAsyncResult`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +130
System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state) +382
System.Web.Mvc.Async.WrappedAsyncResult`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +130
System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +317
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +15
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__2(AsyncCallback asyncCallback, Object asyncState) +71
System.Web.Mvc.Async.WrappedAsyncResult`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +130
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +249
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +50
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +301
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
It seems to me you might be suffering from the lack of double-escaping (do \\v11.0 instead of \v11.0), as discussed in this post.
I'm ashamed to realize I had a typo in my connection strings. I was getting connection strings from Azure Deployment configuration files, such as:
<Setting name="SqlConnectionString" value="Server=Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-********;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-********.mdf" />
The typo was included here, at the start of the value string. It must've been a copy'n'paste bug.
This string was duplicated in Azure configuration files Local.cscfg and Cloud.cscfg, for Azure emulator and Azure deployment respectively, as well as in web.config for running locally outside emulator. The typo was only in the Local.cscfg file, which made me very confused when trying to figure out why it did not work in certain scenarios. In addition the typo was for some reason very hard for me to spot. In hindsight I don't see how I didn't figure this out sooner.
I don't have a solution yet, but here is my own investigation and theory so far:
I took a look at the source code of WebSecurity.InitializeDatabaseConnection() and think maybe I have found a bug. It doesn't seem to ever set the DatabaseConnectionInfo.Type property, which defaults to ConnectionStringName, which could explain why it doesn't like my connection string, since it would interpret it as a connection string name instead.
WebSecurity class:
public static void InitializeDatabaseConnection(string connectionString, string providerName, string userTableName, string userIdColumn, string userNameColumn, bool autoCreateTables)
{
WebSecurity.InitializeProviders(new DatabaseConnectionInfo()
{
ConnectionString = connectionString,
ProviderName = providerName
}, userTableName, userIdColumn, userNameColumn, autoCreateTables);
}
DatabaseConnectionInfo class:
public Database Connect()
{
switch (this.Type)
{
case DatabaseConnectionInfo.ConnectionType.ConnectionStringName:
return Database.Open(this.ConnectionStringName);
case DatabaseConnectionInfo.ConnectionType.ConnectionString:
return Database.OpenConnectionString(this.ConnectionString, this.ProviderName);
default:
return (Database) null;
}
}
private enum ConnectionType
{
ConnectionStringName,
ConnectionString,
}

CommunicationObjectAbortedException during reading large array from server

I'm receiving such exception during reading array of 40000 items.
Is there an idea why does it happen.
I've changed send/receive timeout to 30 min. Not helped.
System.ServiceModel.CommunicationObjectAbortedException was unhandled
by user code Message=The socket connection has been disposed.
Source=mscorlib StackTrace:
Server stack trace:
at System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
at System.ServiceModel.Channels.ConnectionStream.Read(Byte[] buffer, Int32 offset, Int32 count, TimeSpan timeout)
at System.ServiceModel.Channels.ConnectionStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.ServiceModel.Channels.SingletonConnectionReader.SingletonInputConnectionStream.ReadCore(Byte[]
buffer, Int32 offset, Int32 count)
at System.ServiceModel.Channels.SingletonConnectionReader.SingletonInputConnectionStream.Read(Byte[]
buffer, Int32 offset, Int32 count)
at System.ServiceModel.Channels.DelegatingStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.ServiceModel.Channels.MaxMessageSizeStream.Read(Byte[] buffer,
Int32 offset, Int32 count)
at System.ServiceModel.Channels.SingletonConnectionReader.Close(TimeSpan
timeout)
at System.ServiceModel.Channels.SingletonConnectionReader.DoneReceiving(Boolean
atEof, TimeSpan timeout)
at System.ServiceModel.Channels.SingletonConnectionReader.DoneReceiving(Boolean
atEof)
at System.ServiceModel.Channels.SingletonConnectionReader.SingletonInputConnectionStream.Close()
at System.ServiceModel.Channels.DelegatingStream.Close()
at System.Xml.XmlBufferReader.Close()
at System.Xml.XmlBaseReader.Close()
at System.Xml.XmlBinaryReader.Close()
at System.Xml.XmlReader.Dispose(Boolean disposing)
at System.Xml.XmlReader.System.IDisposable.Dispose()
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message
message, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeReply(Message
message, Object[] parameters)
at System.ServiceModel.Dispatcher.ProxyOperationRuntime.AfterReply(ProxyRpc&
rpc)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime
operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins,
Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins,
Object[] outs)
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 AlexSoft.Core.RemoteFacade.Contract.AdministrationSvc.IAdministrationRmService.GetAllBins()
at _dynamic_AlexSoft.Core.RemoteFacade.Contract.AdministrationSvc.IAdministrationRmService.GetAllBins(Object
, Object[] )
at Spring.Reflection.Dynamic.SafeMethod.Invoke(Object target, Object[] arguments)
at Spring.Aop.Framework.DynamicMethodInvocation.InvokeJoinpoint()
at Spring.Aop.Framework.AbstractMethodInvocation.Proceed()
at AlexSoft.Desktop.Services.RemoteFacade.ExtractRemoteExceptionAdvice.Invoke(IMethodInvocation
invocation) in
D:\proj\communic\trunk_fix_not_opened\src\SmartClient\Desktop.Services\RemoteFacade\ExtractRemoteExceptionAdvice.cs:line
15
at Spring.Aop.Framework.AbstractMethodInvocation.Proceed()
at Spring.Aop.Framework.DynamicProxy.AdvisedProxy.Invoke(Object proxy, Object target, Type targetType, MethodInfo targetMethod,
MethodInfo proxyMethod, Object[] args, IList interceptors)
at CompositionAopProxy_8e3e641f50c44b68b5809af44bfae8bd.GetAllBins()
at AlexSoft.Desktop.Services.RemoteFacade.RemoteAdministrationService.<>c__DisplayClass2.b__0(IAdministrationRmService
svc) in
D:\proj\communic\trunk_fix_not_opened\src\SmartClient\Desktop.Services\RemoteFacade\RemoteAdministrationService.cs:line
18
at AlexSoft.Desktop.Services.RemoteFacade.AbstractRemoteService1.ExecuteRmAction(RmAction
action) in
D:\proj\communic\trunk_fix_not_opened\src\SmartClient\Desktop.Services\RemoteFacade\AbstractRemoteService.cs:line
121
at AlexSoft.Desktop.Services.RemoteFacade.RemoteAdministrationService.GetAllBins()
in
D:\proj\communic\trunk_fix_not_opened\src\SmartClient\Desktop.Services\RemoteFacade\RemoteAdministrationService.cs:line
24
at AlexSoft.MPObjects.Desktop.Controllers.UseCaseBinListController.ShowBinListView(IUseCaseBinListController
controller) in
D:\proj\communic\trunk_fix_not_opened\src\SmartClient\AlexSoft.MPObjects.Desktop\Controllers\UseCaseBinListController.cs:line
95
at Microsoft.Practices.Composite.Presentation.Commands.DelegateCommand1.Execute(T
parameter)
at Microsoft.Practices.Composite.Presentation.Commands.DelegateCommand`1.System.Windows.Input.ICommand.Execute(Object
parameter)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource
commandSource, Boolean userInitiated)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs
e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate
genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate
genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport
inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd,
InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x,
Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr
hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean&
handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate
callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object
source, Delegate method, Object args, Int32 numArgs, Delegate
catchHandler) InnerException: System.IO.IOException
Message=The read operation failed, see inner exception.
Source=System
StackTrace:
at System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer,
Int32 offset, Int32 size, TimeSpan timeout)
InnerException: System.ServiceModel.CommunicationObjectAbortedException
Message=The socket connection has been disposed.
Source=System.ServiceModel
StackTrace:
at System.ServiceModel.Channels.SocketConnection.ThrowIfNotOpen()
at System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer,
Int32 offset, Int32 size, TimeSpan timeout)
at System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer,
Int32 offset, Int32 size, TimeSpan timeout)
at System.ServiceModel.Channels.ConnectionStream.Read(Byte[] buffer,
Int32 offset, Int32 count, TimeSpan timeout)
at System.ServiceModel.Channels.ConnectionStream.Read(Byte[] buffer,
Int32 offset, Int32 count)
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security.NegotiateStream.StartFrameHeader(Byte[] buffer,
Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32
offset, Int32 count, AsyncProtocolRequest asyncRequest)
InnerException: System.ObjectDisposedException
Message=The socket connection has been disposed. Object name: 'System.ServiceModel.Channels.SocketConnection'.
ObjectName=System.ServiceModel.Channels.SocketConnection
InnerException:
Did you try to increase the maximum message sizes in the client and server configurations?
You can also have a look at the server to see if an exception has been logged.
The parameter named MaxSerializedObjectsInGraph may also reach its limit when serializing a lot of objects.
This can happen when the server cannot serialise the result object.
Make sure there is no exceptions on serialisation.