access_time 14 years ago language中文
more_vert

编译器错误信息: BC30456: “InitializeCulture”不是 成员 解决办法

visibility 1,239 comment 0

解决办法:

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.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=823980&SiteID=1

在生成/发布网站的时候取消选中"允许更新此预编译站点(U)"

允许更新此预编辑站点

选中这一项后,编译出来的包括aspx文件和dll,与2003下一样。
不选中这一项,编译出来的aspx中没有界面信息,只有一句静态文本,就是不允许发布后修改页面

为了不让订阅网站的用户在第一次打开页面时感受到明显的延迟,可以使用"完全预编译(full pre-compilation)"方式.
如果是想此编译方式具有最大的安全性,应去掉"允许更新此预编译站点(Allow this precompiled site to be updateable". 这样代码文件(code,即cs文件)和内容文件(content file,即aspx)都会预编译

以下是一些解决方法:

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)

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.

而我在开发juic.net网站的时候遇到这个错误的原因已经在今天早上得到解决

原因是自己大意了

public partial class Default : Page

以前少加了个public

哈哈 以后可得注意这些细节了 3. Make sure page directives at the top of aspx files are correct and ‘inherits’ is pointing to your class correctly.

info Last modified by Raymond 14 years ago copyright This page is subject to Site terms.
Like this article?
Share on

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

Follow Kontext

Get our latest updates on LinkedIn.

Want to contribute on Kontext to help others?

Learn more

More from Kontext

visibility 475
thumb_up 0
access_time 9 months ago
visibility 1454
thumb_up 0
access_time 9 months ago