locked
Web Deployment RRS feed

  • Question

  • User1002836352 posted

    I want to install my asp.net application into a web host.

    I created an index.aspx file

    But when I try to view it in the browser following message appears. What is wrong with this.

    My web.config is as follows

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>

    <system.webServer>
      <defaultDocument>
        <files>
          <clear />
          <add value="index.aspx" />
        </files>
      </defaultDocument>
    </system.webServer>
        <system.web>
            <customErrors mode="Off"/>
        </system.web>
    </configuration>

    Server Error in '/' Application.


    Parser Error

    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

    Parser Error Message: Could not load type 'WebApplication4.index'.

    Source Error:

    Line 1:  <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="WebApplication4.index" %>
    Line 2:  
    Line 3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


    Source File: /index.aspx    Line: 1


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34274

    Saturday, February 27, 2016 3:24 PM

Answers

  • User465171450 posted

    Web applications compile into a single dll whereas website projects compile at request time. You will need to publish or build to get the dll built into the bin directory. You will need to move the dll as well as the index.aspx (don't need the .cs or .designer.cs files).

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, February 28, 2016 2:15 AM

All replies

  • User-1315512054 posted

    Hello,

    You should deploy and code behind file - .cs

    Regards

    Saturday, February 27, 2016 5:39 PM
  • User1002836352 posted

    I also have code behind file and designer file as

    index.aspx

    index.aspx.cs

    index.aspx.designer.cs

    When I create asp.net web site from Visual studio

    I upload only index.aspx and index.aspx.cs

    and it works

    but in the case of web application it doesnot work

    Saturday, February 27, 2016 7:44 PM
  • User465171450 posted

    Web applications compile into a single dll whereas website projects compile at request time. You will need to publish or build to get the dll built into the bin directory. You will need to move the dll as well as the index.aspx (don't need the .cs or .designer.cs files).

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, February 28, 2016 2:15 AM
  • User1002836352 posted

    thanks a lot

    Sunday, February 28, 2016 6:25 PM