'InitializeCulture' is not a member of
I'm trying to set up some .NET hosting on a server as a favour for someone but i'm not too familiar with .NET and when the site is uploaded an error is occuring that isn't occuring on their current hosting. The site is compiled so its mostly just DLL files and aspx files, the error message is below. Any ideas what needs done to get this working?
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30456: 'InitializeCulture' is not a member of 'ASP.index_aspx'.
Source 开发者_JS百科Error:
Line 1: <%@ page language="VB" masterpagefile="~/mst_mathsBuddy.master" autoeventwireup="false" inherits="index, App_Web_nl--pcdh" %>
Line 2:
Line 3: <%@ Register Src="Controls/Competition.ascx" TagName="Competition" TagPrefix="uc3" %>
EDIT:
The app is running on IIS6 and ASP.NET version 2.0.5727 which is identical to the currnet hosting.
Page.InitializeCulture() is only supported in ASP.NET 2.0 and higher.
It looks like your hosting provider still uses the .NET 1.1 runtime to serve its websites, or that you didn't configure the proper runtime version for your web application in IIS.
EDIT: Apparently someone there encountered the same problem, and solved it by disabling the Allow this precompiled site to be updatable
feature in the publishing options of their website.
If you are experiencing this error on just one page, then check that the class that your .ASPX file is inheriting from is correct.
In my case, I was experiencing this error on one page only. When I originally created that page, I had copy/pasted the ASPX and ASPX.vb files from an existing page. However I forgot to update the class name in the code behind file (and therefore also in the aspx file in the Inherits property of the Page directive).
This all worked fine in development, but when I compiled and pushed the website to a test server, I started getting this error on that page only:
System.Web.HttpCompileException error BC30456: ''InitializeCulture'' is not a member of.....
Fixing the classname in those two places solved the problem for me.
By allowing the precompiled site to be up updatable feature during publishing converts the whole makes a dll for each page and we can't change any HTML code after publishing which is not good practice. this error occurs due to some problem in page directives so if we make sure that all pages are inherits from a correct class etc then you can get rid of such problems.
I had a perfectly working site and this started happening. I did a 'Clean' and rebuild. Problem went away after that.
How I fixed this problem: I deleted everything on the server then redeployed. (instead of just overwrite/merge with it). Apparently my new code has some conflicts with some old files that were not being overwritten.
For the benefit of others who are following this thread and are not familiar with Visual Studio...
The allow the precompiled site to be up updatable
feature is turned on with:
Website -> Start Options ... -> MSBuild Options
That did not solve my problem; I am posting it here because it took my quite a while to find it.
I have solved the exception By unchecking the 'Allow precompiled site to be updatable' int the "Precompile options" while publishing will solve the issue
I saw this error when moving my project files from "WebSite project" into "WebApplication project".
The solution is:
1) Open your .ASPX file
2) Hit F7 to edit its source-content (.VB or .CS etc)
3) If you see "Partial class ...MyClass..." then replace with "Public class ...MyClass..."
4) If you see "Private Sub Form_Load() Handles MyBase.Load" then replace with "Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load"
5) Re-compile / build your web
6) Run, it should work fine.
Incomprehensibly setting the name of the aspx as the vb code file I have resolved the problem, but it seems estrangely sticky dirty.
i had this error when deploying a precompiled site.
The page that was giving the error, had the same class name as another page in the solution.
I renamed the class of the offending page, recompiled, deployed and the error went away.
I resolved this issue by changing the .vb class name to the same as the form name. Also changed the .aspx page.
Remove bin / dlls from source control.
For me, this was caused by source code repository conflicts in DLL files created by the build.
- Reverting the DLLs (produced by the build) may fix the problem temporarily.
- Deleting the DLLs (produced by the build) from source control may fix the problem permanently.
Ideally, binaries produced by the build will not be checked into source control.
精彩评论