Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

ASP.net: Server Error in '/' Application

Options
  • 27-01-2006 5:02pm
    #1
    Closed Accounts Posts: 216 ✭✭


    Hey,

    I am trying my luck with .Net and C#, but I cant seem to even get a Hello World program running on my web server. It works fine on localhost, but every time I try to run it on my live server, I get the following error:

    Server Error in '/' Application.

    Runtime Error
    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".


    <!-- Web.Config Configuration File -->

    <configuration>
    <system.web>
    <customErrors mode="Off"/>
    </system.web>
    </configuration>


    Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


    <!-- Web.Config Configuration File -->

    <configuration>
    <system.web>
    <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
    </configuration>


    I've tried editing the Web.config file but I am still stuck with the same problem. Any ideas?

    Cheers
    G.


Comments

  • Registered Users Posts: 640 ✭✭✭Kernel32


    Post up your web.config. You probably haven't created the web.config correctly.


  • Closed Accounts Posts: 216 ✭✭gogul


    Kernel32 wrote:
    Post up your web.config. You probably haven't created the web.config correctly.

    That is the most likely problem. Here it is:

    <?xml version="1.0"?>

    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"&gt;
    <appSettings/>
    <connectionStrings/>
    <system.web>
    <compilation debug="true"/>
    <authentication mode="None"/>
    <customErrors mode="Off"/>
    </system.web>
    </configuration>

    G.


  • Moderators, Science, Health & Environment Moderators Posts: 8,950 Mod ✭✭✭✭mewso


    A few things:-

    Have you created a virtual directory in IIS on your live server for this app?
    What version of .Net? (if it's 1.0 or 1.1. and you are compiling your app to a dll in release mode then recompile in debug mode)
    What software are you using to develop the application?


  • Registered Users Posts: 398 ✭✭d@rk l0rd


    Yeah, I had the same problem when I started .NET
    Turns out I needed to get a virtual directory set up on my remote server.

    Are all your files compiling and running OK on the local server?


  • Closed Accounts Posts: 216 ✭✭gogul


    musician wrote:
    A few things:-

    Have you created a virtual directory in IIS on your live server for this app?
    What version of .Net? (if it's 1.0 or 1.1. and you are compiling your app to a dll in release mode then recompile in debug mode)
    What software are you using to develop the application?

    I didnt realise that you needed a virtual directory setup. I'll get onto the hosting company and see if they will sort it.

    I'm using version 1.0 and MS Visual Studio to develop the app. I'm not compiling the app to a dll. It this necessary? I have only started .net programming, so I'm not entirely sure how this should be done.


  • Advertisement
  • Moderators, Science, Health & Environment Moderators Posts: 8,950 Mod ✭✭✭✭mewso


    If you are using Visual Studio then your application is being compiled to a dll automatically. What this means is that when you deploy a wev application you don't need to deploy the code files with it as they are compiled but this means you must deploy the dll which is in the bin folder of the web application. Visual Studio automatically creates a virtually directory on your local machine but when deploying to your live server the virtual directory needs to be created manually but if your live server is provided by a host I would have thought it would have been setup as a virtual directory by them from the start.
    Just to note in Version 2 of .Net a dll is not created by default and code files do need to be deployed.


  • Closed Accounts Posts: 216 ✭✭gogul


    Visual Studio is not actually creating the dll files for me. Are you familiar with this program and where I can turn on this option?

    g.


  • Moderators, Science, Health & Environment Moderators Posts: 8,950 Mod ✭✭✭✭mewso


    Well that is strange. Are you looking in the right place? When you create a web application it creates a folder in your projects folder and a folder in your inetpup/wwwroot folder. If your app is called webapplication1 then the dll will be in inetpub/wwwroot/webapplication1/bin.
    In Visual Studio when you press the play button to run the application and view it in your browser it should automatically create this dll. The only way it wouldn't would be if you were using the 2005 version on Asp.Net 2 or Web Matrix.


  • Closed Accounts Posts: 216 ✭✭gogul


    you got it in one. I'm using VS 2005. Does this mean I will have to do a command line dll build?


  • Closed Accounts Posts: 4,943 ✭✭✭Mutant_Fruit


    Go into control panel->Administrative tools-> Internet Information Services and under Websites -> Default websites, rightclick on your project and choose properties.

    In the "Virtual Directory" folder, make sure that there is an "ApplicationAname" set.

    EDIT: This may be irrelevant for VS2005.


  • Advertisement
  • Closed Accounts Posts: 216 ✭✭gogul


    Yeah, the applicationName is set to the virtual folder name


  • Closed Accounts Posts: 216 ✭✭gogul


    Ok, I think I may have given some incorrect info. I'm actually running version ASP.net 2.0 (I was informed by someone that VS 2005 only runs v2.0).

    I have checked with my hosting company and my website is already setup for ASP.net Version 1. I have changed this to V2.0.

    I have also been able to successfully create a DLL file for this app.

    Unfortunately, things are going from bad to worse. I am now getting a
    "The system cannot find the path specified." error.

    Can anybody shine some light on this problem?

    G.


  • Moderators, Science, Health & Environment Moderators Posts: 8,950 Mod ✭✭✭✭mewso


    O.k. with version 2 you might want to do without a dll. In version 2 you can create a dll but it compiles the html too which I don't like. It's just a matter of ensuring that your host has configured your site to run on version 2 instead of 1 or 1.1 then copy all files to the server.


  • Closed Accounts Posts: 216 ✭✭gogul


    Thankfully my hosting company has an online option to change the version between 1.0 and 2.0. I have done this and tried running a simple inline Hello World page, but I get the "The system cannot find the path specified." error straight out.


  • Closed Accounts Posts: 4,943 ✭✭✭Mutant_Fruit


    with version 2 you might want to do without a dll. In version 2 you can create a dll but it compiles the html too which I don't like.
    In ASP.NET 1.0, 1.1 (and probably 2.0) you get both a .dll and .html output.

    The .html files are the html pages that you see on screen, the .dll file contains all your C# code.

    As a test. Just put up a plain HTML file and see if you can view that. If that works, then create a html file with one label, and try and set some text on that label in the pageload event.

    If neither of those works, then the server is set up incorrectly. Also, does this work on your test enviornment on your development machine? You should be able to view those test pages on your own system.


  • Moderators, Science, Health & Environment Moderators Posts: 8,950 Mod ✭✭✭✭mewso


    2 is different. Thats why I mentioned it. 1.0 and 1.1 create a dll that you deploy with your html files. 2 has a compile option that creates a dll but it compiles your html pages too (aspx html pages) and you are still left with aspx pages but they contain nothing.
    It sounds to me like you have uploaded the aspx page but not the code file perhaps.


  • Closed Accounts Posts: 216 ✭✭gogul


    Here's the problem. I cant even seem to get inline code working. I can run standard ASP pages no problem, so there's no issue with finding the directory on the server. I also have no problems running the .NET pages on my localhost. Below is a sample page I have tried to compile on the remote server.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;

    <html xmlns="http://www.w3.org/1999/xhtml&quot; >
    <head>
    <title>Test Page</title>
    <script language=CS runat=server>
    void Page_Load(object sender, System.EventArgs e)
    {
    Response.Write("Hello World!");
    }
    </script>
    </head>
    <body>
    </body>
    </html>

    I cant even seem to get that to work. I keep getting the "The system cannot find the path specified." error. I dont think it's a problem with not finding the page, it sounds like its a problem find a resource the page is using. Guess I'll get back onto my hosting company and see what I can do. Alternatively, I might just use some other dev tools and test some ASP.NET 1.1 files.

    G.


  • Closed Accounts Posts: 216 ✭✭gogul


    Ok, just got a message back from the hosting company. Turns out that even though the option to change to ASP.NET 2.0 was an online option, the server itself did not support it. They're gonna update it tonight and, hopefully, by tomorrow I will have full compiling and running capabilities!!

    Cheers for all your help and time

    G.


Advertisement