Codebehind issues when deploying a WAP to server

Last post 06-19-2009 7:31 AM by manohar_s. 5 replies.

Sort Posts:

  • Codebehind issues when deploying a WAP to server

    07-13-2007, 7:47 PM
    • Member
      111 point Member
    • Dimebrain
    • Member since 07-13-2007, 11:41 PM
    • Posts 72

    Hello,

     On my local machine I am able to build and run my web application project. When I publish it to the server, I receive the following error:

    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: The file '/MasterPage.master.cs' does not exist.

    From my understanding, my application is compiled into a .dll so a reference to a .cs file shouldn't be required. I thought about the fact that the solution is in the WebSiteName folder, but I need to publish it on my server to the WebSiteName/wwwroot/ directory. Is the discrepancy tripping up the embedded relative paths in the .dll? If I add the MasterPage.master.cs file as a lark, I just receive an identical error regarding Default.aspx.cs; it's trying to find the codebehind files and it can't.

    The bin directory resides @ WebSiteName/wwwroot/bin ... since I cannot change the requirement to publish to the wwwroot directory on my shared host, is there another way around this?

    Some day I'll be able to answer more questions than I ask.
  • Re: Codebehind issues when deploying a WAP to server

    07-16-2007, 3:41 PM
    Answer
    • Contributor
      2,365 point Contributor
    • timmcb
    • Member since 11-04-2002, 4:29 PM
    • Redmond, WA
    • Posts 469
    • AspNetTeam

    Are you using the codebehind, codefile, or src attribute in the master page? You should be using the codebehind attribute in a Web Application Project and the codefile attribute in a Web Site.  Can you post the ASP.NET directives from the top of your master page?

    Tim McBride

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Codebehind issues when deploying a WAP to server

    07-16-2007, 7:26 PM
    • Member
      111 point Member
    • Dimebrain
    • Member since 07-13-2007, 11:41 PM
    • Posts 72

    Hello,

    My ASP.NET directives for my MasterPage did indeed use CodeFile, not Codebehind. I was using a MasterPage re-used from a previous project and missed this tag. This seems to be forgivable in the development environment but not so in production. I changed this one reference and all is well. Many thanks!



     

    Some day I'll be able to answer more questions than I ask.
  • parser error for .aspx.cs files when deploying a Webapplication with dll in IIS

    09-11-2007, 4:31 PM
    • Member
      4 point Member
    • padmajab
    • Member since 09-11-2007, 6:49 PM
    • Posts 2

    Hi,

     I am using VS 2005 (.Net 2.0). I have web application which compiles into dll.  When I publish it to the server and browse the Default.aspx, I receive the following error:

    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: The file '/Default.aspx.cs' does not exist.

    My page tag is

    <%@ Page Language="C#" AutoEventWireup="true" Inherits="_Default" CodeFile="Default.aspx.cs" %>

    Is it required to have all .cs files if i use CodeFile attribute?

    Thanks

    Padmaja

  • Re: parser error for .aspx.cs files when deploying a Webapplication with dll in IIS

    09-12-2007, 5:27 PM
    • Member
      4 point Member
    • padmajab
    • Member since 09-11-2007, 6:49 PM
    • Posts 2

    Changind codefile="default.aspx.cs" to codebehind="default.aspx.cs", working fine. I think when we use codefile, all .cs files should be present in the web server. Web site will automatically deletes all codefile attributes in .aspx pages when it is published using Publish Website option.

    Thanks

    Padmaja

  • Re: parser error for .aspx.cs files when deploying a Webapplication with dll in IIS

    06-19-2009, 7:31 AM
    • Member
      8 point Member
    • manohar_s
    • Member since 10-17-2008, 9:41 AM
    • Posts 4

    Hi,

    Thanks for the information provided, It helped me to deploy my application.

    when I published the web site from my VS IDE master page page directive contains "Codebehind=Master.master.cs"  but, when I published the website it is automatically converted to "Codefile=Master.master.cs",

    Can you tell me what is the culprit for this issue

     

     

    Manohar S
Page 1 of 1 (6 items)