Windows 2003 Server SP1, ASP.Net 2.0
BC30456: 'InitializeCulture' is not a member of
Have a bug in your code but throws this error instead of the actual error? Or getting this error randomly? Or a similar error complaining that an asp.net method is not a member of a class like 'Page' when it is!? and mashing refresh a few times sometimes makes it go away...
After 2 Days of extensive search on the internet and finding plenty of people with this error and very little replies and resolutions, I took upon myself to get to the bottom of this (unacknowledged ASP.net framework bug) and list some steps to help all of you work around it.
1. If you use Visual studio to publish your site, during the publishing stage on framework 2.0 uncheck the "allow this precompiled site to be updatable".
2. Ensure ASP.Net is installed correctly, I found that my Web Server root was configured to use ASP.Net 1.1 by default so ran the following line to fix it to 2.0 even though my site was configured for 2.0 at site level, eliminating this glitch seems logical.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -i
This will also fix any mapping/installation problems.
Also ran aspnet_regiis -r
This will replace all mappings recursively to 2.0 regardless.
3. Make sure page directives at the top of aspx files are correct and ‘inherits’ is pointing to your class correctly. I could not see any problems with mine, so did not explore down this path to thoroughly, but noted others saying issues with ambiguous inheritance maybe related.
4. Declare culture in your web.config, example
<globalization uiCulture="en" culture="en-NZ" />
OR
<globalization uiCulture="auto" culture="auto" />
5. Change debug="true" to "false" in web.config and any pages which have it set (I recommend removing it entirely from pages and just using web.config)
* This final step eliminated the problem for me, very weird.
Now if this last step eliminates the problem, and later on down the track you get an error in your codebehind file while coding or debugging, you will no longer be pointed directly to the line in your codebehind file when an exception occurs, asp.net will just show you the line in the aspx file you called from. Temporarily switch debug back to true in web.config if you can't figure out the problem and then you can see it, if InitializeCulture crops back up instead, mash refresh a few times like you used to do! Then turn debug back off.
---
Does anyone else have anymore info?
My question to Microsoft, why does this behaviour exist? Is it by design or really a bug? If so, why is there no acknowledgment of it as a bug for ASP.Net 2.0?
-juicyjuice