locked
Cannot find control declarations or designer file but can reference in code behind RRS feed

  • Question

  • User811538126 posted

    I am debugging an old project built in VS 2013 version 12.0.21005.1 

    The website is working fine in production but I see it doesn't have any .aspx.designer.cs code behind. 

    The control variables are not declared anywhere and visual studio 2017 doesn't compile currently. interestingly enough, I can access web controls in code behind auto complete.

    I usually read about issues with declared controls not showing up in code behind auto complete, but this is opposite.

    So what's going on here, how is the website working as I don't see any dll files related to this project in the bin folder either.

    Tuesday, November 24, 2020 6:50 PM

Answers

  • User811538126 posted

    My issue is resolved. All it needed was a knowledge of older version of ASP.NET website where a CodeFile is specified - this indicates code will be compiled when webpage is first requested - this is the reason I don't see any dlls in the bin folder and more importantly, no designer.aspx.cs pages or control variable declarations

    https://stackoverflow.com/questions/73022/codefile-vs-codebehind

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 30, 2020 2:41 PM

All replies

  • User475983607 posted

    The website is working fine in production but I see it doesn't have any .aspx.designer.cs code behind. 

    Must be a Web Application.  Web Applications compile cs files into a dll within the bin folder.

    So what's going on here, how is the website working as I don't see any dll files related to this project in the bin folder either.

    You must be mistaken. 

    Tuesday, November 24, 2020 7:04 PM
  • User811538126 posted

    I am new to asp.net and what we have here is a little used website with only the aspx and .cs pages. the bin folder doesn't have any dll but it might be pointing to some place else, so that's the unknown.

    What i am seeing is in VS 2017, if i just open the .aspx page and drop a control from toolbox, I see the control is recognized by autocomplete in code behind and I also see it on the web page. But any change i do on the .cs page isn't reflected (obviously as it's not compiled)

    I don't have a solution file, when i start with a blank .sln file, compiler complains of missing declarations for all controls.

    Without trying to understand how .aspx, .designer.aspx.cs .cs and .dll files interact(wasn't aware it was this complex), is there a way i can get the code to compile with the small change i want to make in the .cs file of couple pages?

    mdfaraz

    The website is working fine in production but I see it doesn't have any .aspx.designer.cs code behind. 

    Must be a Web Application.  Web Applications compile cs files into a dll within the bin folder.

    mdfaraz

    So what's going on here, how is the website working as I don't see any dll files related to this project in the bin folder either.

    You must be mistaken. 

    I might be mistaken to the extent the bin folder may be pointing to some other directory when the code was compiled.

    Tuesday, November 24, 2020 9:01 PM
  • User811538126 posted

    My issue is resolved. All it needed was a knowledge of older version of ASP.NET website where a CodeFile is specified - this indicates code will be compiled when webpage is first requested - this is the reason I don't see any dlls in the bin folder and more importantly, no designer.aspx.cs pages or control variable declarations

    https://stackoverflow.com/questions/73022/codefile-vs-codebehind

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 30, 2020 2:41 PM