开发者

How can I trigger Visual Studio 2010's updates to the webform/usercontrol designer.cs file?

I made updates to an ascx file that include new server controls in the user control and Visual Studio 2010's original attempt to update the designer file failed because the file was set to readonly due to an unfortunate choice of source control.

I've made the file editable, but can't seem to figure out how to retrigger the update. I've even removed my original ascx changes, hit save, then put them back in, saving yet again. How can I trigger 开发者_运维百科VS2010's update of the designer.cs file?


Surely there's a better way, but as a workaround, I added and removed a literal control:

<asp:Literal ID="JustMakeTheFileUpdate" runat="server"></asp:Literal>

That worked, but somehow removing and re-adding the controls that failed the first time doesn't work.


Adding the literal control worked for me - was tearing my hair out with this! Just to confirm, I emptied the class definition in the existing designer file (so it was just an empty class) and then went back to the markup and pasted in the literal control in the answer. That caused a regneration (at last!).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜