您可以在不更新整个站点的情况下更新 Web 用户控件吗?
我有一个使用网络用户控件的网站......嗯,基本上无处不在。 它甚至包含在其他 Web 用户控件中。
所以我想我可以上传新的源代码,它会立即重新编译并且没问题,但是使用它的每个页面或控件都会抱怨类型不匹配。 因为它被用在很多地方,所以更新整个网站很快就会变得更容易。 (或者至少如果我不需要为此经历我们的变更管理流程的话......)
那么我是否遗漏了一些东西? 有没有办法像更新单个网页一样上传 Web 用户控件并重新编译它?
I have a website which uses a web user control... well, basically all over the place. It's even included in other web user controls.
So I thought I could just upload the new source and it would recompile on the fly and be fine, but instead every page or control that uses it complains about a type mismatch. Because it is used in so many places, it very quickly becomes easier to just update the entire website. (Or at least it would if I didn't need to go through our change management process for that...)
So is there something I'm missing? Isn't there any way to upload a web user control and have it recompile like when you update a single web page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为它正在重新编译,只需要一点时间,并且在重新编译时与临时 ASP.NET 文件中不匹配的 .ascx 和 .ascx.cs 文件发生冲突。 我对此可能是错的。就我个人而言,如果我始终一起上传 .ascx 和 .ascx.cs 文件,我会取得更好的成功。
I think it is recompiling, it just takes a bit and you have a conflict with the mismatched .ascx and .ascx.cs files in Temporary ASP.NET Files while it recompiles. I could be wrong about this. Personally, I've had better success if I always upload both the .ascx and .ascx.cs files together.
我认为,如果您推送这些项目,您应该会很好...如果少了,您可能会遇到问题:
bin 内容 - 这将包括您对用户控件的代码更改,如果程序集版本发生更改,您将需要包括使用它的任何 .dll,我多次尝试推送 bin 中的单个 .dll 时遇到问题。
.ascx 文件
我认为您不需要推送任何其他 .aspx 或 .ascx 文件。
I would think that if you pushed these items you should be good... any less and you might have issues:
bin contents - this will include your code changes to the user control and if the assembly version changes you will want to include any .dll that use it, I have run into issues to many times by trying to push just a single .dll that is in the bin.
.ascx file
I don't think you would need to push any other .aspx or .ascx files.