CZEMacLeod / MSBuild.SDK.SystemWeb

This MSBuild SDK is designed to allow for the easy creation and use of SDK (shortform) projects targeting ASP.NET 4.x using System.Web.
MIT License
151 stars 8 forks source link

`designer.cs` doesn't get generated for `aspx` files #42

Closed chucker closed 1 year ago

chucker commented 1 year ago

def21c24aa764ee5094a15850581ca8bf8dd99b2 added WebForms files as Content. That's fine for publishing, but it doesn't update the .aspx.designer.cs file.

VS's properties on the old SDK just show Content as the Build Action, and there's no Custom Tool either, so I'm unsure how to reverse-engineer the behavior.

For example, if you insert this into a aspx file and wait for a moment:

                <asp:Label ID="Foo" runat="server" />

…then that'll generate this:

        /// <summary>
        /// Foo control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Foo;

I couldn't find anything like "generate ASP designer.cs from command line". Perhaps this entire toolchain predates MSBuild and therefore isn't available as a task…

CZEMacLeod commented 1 year ago

Hi @chucker. This has already been covered in some depth in issue #11 and is basically a limitation of the system. The mechanism that updates the .designer.cs files when editing an .aspx file is part of VS, and the tooling is only active for legacy projects with the appropriate Web Application project type. It would require someone on the VS team to be able to adjust this and enable it for a project capability we could add to the SDK. Unfortunately, I don't know anyone on that team to see if it is something they would consider. MSBuild does not enter into this, as it is an editor/design time issue, not a build issue.

chucker commented 1 year ago

Thanks for answering and apologies — I could've sworn I looked for existing issues and didn't see that one. :)