.NET WAP 发布问题 - 发布中包含代码文件

发布于 2024-07-25 21:46:39 字数 368 浏览 5 评论 0原文

我正在使用 Web 应用程序项目来开发一些 Web 用户控件(c#)。

在 WAP 中,用户控制指令包含代码文件并继承属性。

当我将 WAP 发布到目标网站时。 bin 中的 dll 已正确复制到网站的 bin,用户控件(.ascx 文件)已正确复制。

当我在网站上执行构建时,我收到错误,因为 ascx 文件仍然包含指令中的 codefile 属性。 为了解决这个问题,我只需删除 codefile 属性,ascx 仍然可以工作,因为代码是通过继承(现在位于 dll 中)获取的。

我的问题是 - 发布可以自动为我删除代码文件属性吗? 或者..我是否错误地使用了 WAP/构建/发布?

非常感谢, 亚当

I am using a Web Application Project to develop some web user controls (c#).

In the WAP the user control directive contains the codefile and inherits attributes.

When I publish the WAP to the target website. The dll from bin is copied correctly to the bin of the website, the user controls (.ascx files) are copied correctly.

When I perform a build on the website, I get errors as the ascx files still contain the codefile attribute in the directive. To resolve this I simply remove the codefile attribute and the ascx still works as the code is picked up through the inherits (which is now in the dll).

My question is - can the publish automatically remove the codefile attribute for me. or.. am I using WAP / Build / Publish incorrectly?

Many Thanks,
Adam

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

︶葆Ⅱㄣ 2024-08-01 21:46:39

如果您使用的是 Web 应用程序项目,则 aspx 页面和 ascx 控件应在页面指令中使用 CodeBehind 而不是 CodeFile 属性。

If you are using a web application project, the aspx pages and ascx controls should use CodeBehind instead of CodeFile attribute in the page directive.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文