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

BC30456: 'InitializeCulture' is not a member of FIXES
joesanders
dwitt
gijshompes
Here is another situation in which the 'InitializeCulture' is not a member of... error occurs. This one applies to those of us who write ASPX pages without using the Visual Studio environment. I wanted to include a very short javascript in my ASPX page. So I blithely wrote the following code:
HttpContext.Current.Response.Write("<script language=javascript>")
HttpContext.Current.Response.Write(... a few lines of javascript code...)
HttpContext.Current.Response.Write("</script>")
It threw the error until I re-wrote this as:
HttpContext.Current.Response.Write(chr(60) & "script language=javascript" & chr(62))
HttpContext.Current.Response.Write(... a few lines of javascript code...)
HttpContext.Current.Response.Write(chr(60) & chr(47) & "script" & chr(62))
dragoncells
I was confused, attempted most steps, but what worked for me was removing my code from its initial NameSpace and then refering to the classes by their full name, i.e. namespace.classname.
hope this helps some people.
georgeob
Since making the above posting, I have discovered more information about number (3) ambiguous inheritance, which is my issue and by the sounds of it yours too. I'm going to be updating my post in the next few days with new information relating to the inheritance system and how pages are compiled under vs 05 and .Net 2.0 vs 1.1
Your generated aspx files are all using the same CodeFile, yes From what I'm understanding you can not have multiple aspx files using the same codefile! It seems weird, but this error seems to start occurring when more and more aspx files are using the same codefile.
Yeh would be nice to get some official help, trust me, I've tried all avenues.
Sandy Place
I've tried all of the above mentioned fixes to this, but it keeps coming back. The frustrating thing is that it is intermittent, i.e., one page will be working, then after a time, it'll not work, but another which didn't work will start working.
My situation is different slightly to those above, as they all seem slightly different from each other. I have a web app which I've built which has a very simple CMS. When a new page is added in through the CMS, it copies the existing "Pages.aspx" file which just has a couple of web user controls for the content dynamically added to it at run time.
The File name is stored in the database, as is the content which is rendered in the Web User Controls, then at run time, the page is requested, and it loads the code behind of pages.aspx which gets the apropriate content from the database based on the name of the page being requested, so we have a file which is pages.aspx which has
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="pages.aspx.vb" Inherits="Pages" MasterPageFile="~/atzmi.master" %>
<%@ Register Src="WUCLeftNav.ascx" TagName="WUCLeftNav" TagPrefix="uc1" %>
<%@ Register Src="WUCMultiRowTemplate.ascx" TagName="WUCMultiRowTemplate" TagPrefix="MRT" %>
<%@ Register Src="WUCStandardTemplate.ascx" TagName="WUCStandardTemplate" TagPrefix="SDT" %>
<asp:Content runat="server" ID="content1" ContentPlaceHolderID="ContentPlaceHolder1">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" style="height: 15px">
<asp:PlaceHolder runat="server" ID="plhLeftNav" EnableTheming="false" />
</td>
<td valign="top" style="height: 15px">
<asp:PlaceHolder runat="server" ID="plhContent" EnableTheming="False" />
</td>
</tr>
</table>
</asp:Content>
Each ofthe other content pages ends up identical except of course for the file name. This means that a file called "AboutUs.aspx" would have Inherits"Pages" This works fine in the development environment, but after using the Visual Studio Publish function, these pages load sometimes, or sometimes not.
Could we please have a response to this from Microsoft so that this issue can be put to bed finally. Any response would be better than the silence there seems to be around it.
Thank you,
Dawson.
Leon Mayne
Your generated aspx files are all using the same CodeFile, yes From what I'm understanding you can not have multiple aspx files using the same codefile! It seems weird, but this error seems to start occurring when more and more aspx files are using the same codefile.
Thanks! This is what exactly got me - it took me hours before I see your post.
Sometimes I copy and rename a *.aspx and *.aspx.vb before I make some major changes, then go on making the changes with my new copy. I didn't realized in the backup file, it's still pointing to the old Code File. If that's the case, and if you indeed add any new control in the new copy file, then during build it will give this BC 30456 error that XXX is not a member of XXX. And it is true that the new control doesn't exist in the backup *.aspx file. So be careful not to make the same mistake.
Blast
Thanks so much for your generous contribution! You're a life saver.
--Karl
Alexander K
Your #4 worked for me. I replaced my globalization line in my web.config file with:
<globalization requestEncoding="utf-8" responseEncoding="utf-8" uiCulture="auto" culture="auto" />
droujav
GiovanniP
Philip Simons
Dear JuicyJuice,
Thanks for your post - until I read this I thought I was going crazy.
Step 5 was the last stage that fixed the problem for me too. Many thanks!
Ian1971
Thanks for this post! I too had a hard time figuring this out... Unfortunately, I tried your steps above and none of them worked. They did point me to a solution though:
We were trying to publish our ASPX pages to a mixed site; some DLL's had been compiled in .NET 1.1, and we were moving to 2.0. All of our pages with code-behind derived from our own custom Page class, and I realized that simply upgrading the site to 2.0 would not force a rebuild of those original DLL's (on top of which all the ASPX pages sat). My understanding of the page build lifecycle is that the JIT .NET compiler won't rebuild anything unless the files actually change - in this case the ASPX was different, but not the parent class (in our 1.1 DLL's), so while the page was being rebuilt it was attempting to bind to an older compilation of the parent class that did not have the new 2.0 bindings to culture information.
So, we simply rebuilt the 1.1 DLL's (using VS 2003 - NOT VS 2005 - they are still 1.1) and republished to the bin folder, and then the problem disappeared.
It makes sense, because the original compilation in 1.1 would have still been there, and obviously none of the new 2.0 stuff - like Culture enhancements - would be there. Forcing .NET to recompile the base libraries resolved it for us.
redshock
yes, clearing the app bin fixed it for me
:)