ASP.NET does not work in the server like it does locally

Posted by Zhang Jingchu under ASP.NET on 4/8/2013 | Points: 10 | Views : 1274 | Status : [Member] | Replies : 1
I have written some code that works fine locally but when I put it on the server, it throws some errors. I made the changes that it asks for but I still get these errors. Andy Advice?

Description:
An application error occurred on the server. The current custom error
settings for this application prevent the details of the application error from
being viewed remotely (for security reasons). It could, however, be viewed by
browsers running on the local server machine.

Details: To enable
the details of this specific error message to be viewable on remote machines,
please create a <customErrors> tag within a "web.config" configuration
file located in the root directory of the current web application. This
<customErrors> tag should then have its "mode" attribute set to "Off".

I think the issue is that I need to "Publish" when I build the system. But even after I publish the content (a proess that takes a long time, I might add), I still get thie error

http://i67.photobucket.com/albums/h292/Athono/runtimeerror_zps2d8ae065.png

I have tried publishing a number of times in a number of different ways and I still get the same error.

http://i67.photobucket.com/albums/h292/Athono/debug/configurationmanagerdebugistrue_zpsd258ca5b.png

The code contains a class for debugging by posting text to the browser:

    public class DebugTextWriter : System.IO.TextWriter
{
public override void Write(char[] buffer, int index, int count)
{
HttpContext.Current.Response.Write("<textarea>" + new String(buffer, index, count) + "</textarea>");
//System.Diagnostics.Debug.Write();
}

public override void Write(string value)
{
HttpContext.Current.Response.Write("<textarea>" + value + "</textarea>");
//System.Diagnostics.Debug.Write(value);
}

public override Encoding Encoding
{
get { return System.Text.Encoding.Default; }
}
}


But even if I istantiate a clase for this in the page_load method of the the default.aspx.cs, it still does not get called:

    protected void Page_Load(object sender, EventArgs e)
{
DebugTextWriter dbgTextwriter = new DebugTextWriter();
dbgTextwriter.Write("Page_Load called");


Please advise.




Responses

Posted by: Jayakumars on: 4/8/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

check ur PErmission of the Corresponding Folder

customErrors off needed

Mark as Answer if its helpful to you

Zhang Jingchu, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response