"Collection is read-only" Exception

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
7/1/2010 5:28:16 AM
Gravatar
Total Posts 1
Joy, frustration, excitement, madness, aha's, headaches ... codito ergo sum!

"Collection is read-only" Exception

* What environment?

Win hosting, using DotNetPanel 2.x Enterprise Gold Edition for administration

* What operating system?

Windows Server 2008 R2 x64 + IIS 7.5

* What database platform?

MySQL Community Edition 5.x

* What version of mojoPortal?

2.3.4.5 for .NET 4.0, configured to run in ASP.NET 4.0 mode with Integrated pipelines

* Steps to produce the problem, expected results, actual results

1. Downloaded code for 2.3.4.5 version from codeplex

2. Built mojoportal.sln solution and built deployment package for Mojo.Web project.

3. Removed missing files: /NeatUpload/AccessSession.aspx, /NeatUpload/ProgressBar.js and added csshandler.ashx from deployment archive( mojoportal-2-3-4-5-mssql-net40-deploymentfiles.zip)

4. Added files from mojoportal-2-3-4-5-mysqldatalayer-GPL.zip, as instructed in the ReadMe file

5. Moved the deployment files on the hosting server, from Web\obj\Release\Package\PackageTmp\ folder

6. Configured mojoPortal directory as a Virtual Directory in the web site

7. Created the missing directories in Data folder, as Setup complained about  them; changed CustomErros to off in web.config

8. After completing mojoPortal setup, I logged in with user/passwd: admin@admin.com/admin, as instructed and I received the following ASP.NET error:

Server Error in '/' Application.
Collection is read-only.
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 code.

Exception Details: System.NotSupportedException: Collection is read-only.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NotSupportedException: Collection is read-only.]
System.Collections.Specialized.NameValueCollection.Set(String name, String value) +7906350
System.Web.HttpRequest.SynchronizeHeader(String name, String value) +79
System.Web.Hosting.IIS7WorkerRequest.GetHeaderChanges(HttpContext ctx, Boolean forRequest) +1522
System.Web.Hosting.IIS7WorkerRequest.SynchronizeVariables(HttpContext context) +122
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +671


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

9. Expected results: I should've been logged in, to configure mojoPortal further.

I have another mojoPortal configured on another web site (ASP.NET 2.0) , on the same hosting server/account and it works great so it must have something to do with IIS and ASP.NET 4.0.

If needed, I can try/test possible fixes/ideas.

Thanks!

 

7/1/2010 6:34:00 AM
Gravatar
Total Posts 18439

Re: "Collection is read-only" Exception

Hi,

As far as working with the source code, this is where you went wrong.

2. Built mojoportal.sln solution and built deployment package for Mojo.Web project.

Though it was reasonable to think the VS Publish feature would work, it does not work well with the way we keep features in separate projects and use post build events to move needed files up to the Web folder because it wants to use project membership as the basis for which files to include. You should package builds the way I do using the free UnleashIt Tool.

Regarding the Collection is Read Only error, I have never encountered it myself but a few support questions have reported that problem and were able to solve it by using the medium trust configuration. But also, it is likely missing needed files if you packaged a build using the VS publish feature.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.