I have some custom controls from another project that I've imported into SF4. I added the project DLL from a webapp as a reference and copy the ASCX files into the SF project.
Simple controls work fine. But when I try to do data access, I get the exception below. Data access is done via NHibernate. The same control worked in 3.7 SP. If I set a breakpoint in the control, data access works fine, I can see the data via a quickwatch. But for some reason, the following exception is thrown. If I replace the data access with hard-coded values, the control renders fine.
Collection was modified; enumeration operation may not
Description: An unhandled exception occurred during
the execution of the current web request. Please review the stack trace
for more information about the error and where it originated in the
Exception Details: System.InvalidOperationException:
Collection was modified; enumeration operation may not execute.
[InvalidOperationException: Collection was modified; enumeration operation may not execute.]
Telerik.Sitefinity.Web.SitefinityHttpModule.Context_EndRequest(Object sender, EventArgs e) +254
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75