How to Configure website to allow updating

NathanD88 0 Reputation points

I have an 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

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

1 answer

Sort by: Most helpful
  1. Bruce ( 55,366 Reputation points

    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 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