Tuesday, September 6, 2011

BC30456: 'InitializeCulture' is not a member of 'ASP.userlogin_aspx'.

pernah tak korang dapat error mcm ni bile korang update solution yang dah deploy kat server. bila korang bukak web terus jer dapat error ni...
susahnye hidup aku mase mengadap error ni..dekat 4 hari juga la cari punca.. google la ape2 solution yg dicadangkan then apply kat system...hasil nye same la juga

at the end aku perasan deployment folder aku dah tukar nama so dengan pantas aku ikut name yang asal...alhamdulillah berjaya juga akhirnye...

ape pon ni antara solution yg aku dpt mase google2 wlwpun x berguna utk aku tp berguna untuk org lain....

Compiler Error Message: BC30456: 'InitializeCulture' is not a member of 'ASP.userlogin_aspx'.

solution

/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.

(have to check again)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



OR



/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.

yang ada / tu aku dah cuba... so kl korg dapat error ni, cuba la solution di atas yer

No comments: