How to Configure asp.net website to allow updating

NathanD88 0 Reputation points
2023-08-31T17:24:35.39+00:00

I have an asp.net Website which i publish to a local folder/ file share. I currently use visual studio 2022 Community edition (free).

On previous versions of visual studio (specifically 2017), when publishing single pages/files, the compiler would recompile the cs files and the changes would be reflected after refreshing the page. When i publish a single page now, only the .ASPX file is updated, the codebehind (page.aspx.cs) files are never updated unless I clean the solution, rebuild and publish the project.dll file manually.

How do I configure vs2022 Community to allow the re-compilation of cs files when publishing?

Please see screenshots for Publish configuration

Publish Configuration

User's image

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,417 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 61,731 Reputation points
    2023-09-03T20:39:07.7+00:00

    there are two types of webforms projects. website, where the code is compiled on the server with the aspnetcompiler and web application project. in web application projects, the code behind files are compiled into a dll, and only the .aspx is compiled on the host.

    the web site model uses the codefile="filename" attribute and the cs file is included in the publish. the web application uses the codebehind="filename" and only the dll is included in the publish. web application may require a designer file which is the bridge between the code behind cs file and .aspx file.

    with asp.net 4, the inherits attribute instead of the code behind and the designed file is no longer used, instead the form objected are defined in the code behind.

    0 comments No comments