你如何强制Visual Studio中重新生成ASPX / ASCX文件.designer文件? [英] How do you force Visual Studio to regenerate the .designer files for aspx/ascx files?

查看:568
本文介绍了你如何强制Visual Studio中重新生成ASPX / ASCX文件.designer文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时候,当我编辑页面或控制.designer文件停止在与我把页面上的新控件更新。我不知道是什么导致这种情况发生,但我不知道是否有强制Visual Studio中重新生成.designer文件的任何方式。我使用Visual Studio 2008

Sometimes when I'm editing page or control the .designer files stop being updated with the new controls I'm putting on the page. I'm not sure what's causing this to happen, but I'm wondering if there's any way of forcing Visual Studio to regenerate the .designer file. I'm using Visual Studio 2008

编辑:对不起,我应该已经注意到我已经尝试过:

Sorry I should have noted I've already tried:


  • 关闭和放大器;重新打开所有文件和放大器; Visual Studio中

  • 在页面上进行更改为=服务器控制

  • 删除&安培;重新添加页面指令

推荐答案

如果您打开设计视图和HTML视图之间的.aspx文件和开关
回到它会提示VS检查控制,并添加任何缺失到
设计师档案。

If you open the .aspx file and switch between design view and html view and back it will prompt VS to check the controls and add any that are missing to the designer file.

在VS2013-15有一个转换为Web应用程序指挥下的项目菜单。此前VS2013这个选项在右键单击上下文菜单是可用于为(C / P)×文件。当这样做,你应该看到,你现在有一个*了.Designer.cs文件中提供和设计HTML中的控制将可用于您的控制。

In VS2013-15 there is a Convert to Web Application command under the Project menu. Prior to VS2013 this option was available in the right-click context menu for as(c/p)x files. When this is done you should see that you now have a *.Designer.cs file available and your controls within the Design HTML will be available for your control.

PS:这不应该在调试模式下进行,因为不是一切都重新编译调试时

PS: This should not be done in debug mode, as not everything is "recompiled" when debugging.

有些人也报告成功通过删除了.Designer.cs文件,然后重新创建具有相同名称的空文件。

Some people have also reported success by deleting the .designer.cs file and then recreate an empty file with the same name.

这篇关于你如何强制Visual Studio中重新生成ASPX / ASCX文件.designer文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆