简体   繁体   English

将ascx.cs文件添加到生产Web应用程序

[英]Add ascx.cs file to production web application

One of our clients has installed our web application into production. 我们的一位客户已将我们的Web应用程序安装到生产环境中。

We need to do a very quick patch to one of the aspx controls. 我们需要对aspx控件之一进行快速修补。 I tried dropping the ascx and ascx.cs source files into the dir and unsurprisingly I got this error: 我尝试将ascx和ascx.cs源文件拖放到dir中,毫不奇怪我得到了这个错误:

Exception type - HttpParseException - The base class includes the field 'foobar', but its type (UserControls_Controls_FOO) is not compatible with the type of control (ASP.usercontrols_controls_foo_ascx). 异常类型-HttpParseException-基类包含字段'foobar',但其类型(UserControls_Controls_FOO)与控件的类型(ASP.usercontrols_controls_foo_ascx)不兼容。

Yes, this approach is never a good idea, but is there anything I can do to the control to get it to run in the site instead of the version compiled into the DLL? 是的,这种方法永远不是一个好主意,但是我可以对控件做任何事情以使其在站点中运行,而不是在DLL中编译版本吗?

Doing a fresh install is not an option at this point. 此时,不能进行全新安装。

不,您只需要将其放入编译的DLL中并重新部署,您就可以看到该补丁程序正在运行

If you changed only ascx file you must update only it. 如果仅更改了ascx文件,则必须仅对其进行更新。 But if you updated ascx.cs you must Publish project and replace old bin directory with new one. 但是,如果更新了ascx.cs,则必须发布项目并将旧的bin目录替换为新的bin目录。

Also you can transform site to set of dynamically compiled pages, but it is hardcore old way and bad idea nowadays. 您也可以将站点转换为一组动态编译的页面,但这是当今最顽固的旧方法和坏主意。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM