ASP.NET 在页面加载时编译,但不在 Ctrl+Shift+B 上编译
在卡西尼调试期间,代码运行良好,但是当我显式构建它时,编译在一个对象上中断,说它找不到引用。在断点期间显示对对象的正确引用,并且我可以查看调试智能感知。
代码本身很简单
using CFTW.Controls;
...
controls_LatestPresentations c = LoadControl("~/controls/LatestPresentations.ascx") as controls_LatestPresentations;
c.loadContent();
return RenderControl(c);
该控件是一个简单的用户控件,具有命名空间 CFTW.Controls。调用代码位于 Web 控件中,该控件位于同一文件夹中。我什至尝试将调用代码添加到同一名称空间。
编辑:最大的问题是我无法发布 dll。嗯,无论如何,在高水平上。
during debug in cassini the code runs fine, but when I explictly build it, the compile breaks on an object saying it can't find the reference. During a breakpoint shows the proper reference to the object, and I can view the debug intellisense.
The code itself is simple
using CFTW.Controls;
...
controls_LatestPresentations c = LoadControl("~/controls/LatestPresentations.ascx") as controls_LatestPresentations;
c.loadContent();
return RenderControl(c);
The control is a simple user control, with the namespace CFTW.Controls. The calling code is in a webcontrol, which lives in the same folder. I even tried adding the calling code to the same namespace.
EDIT: The biggest issue is that I cannot publish the dll's. Well, at a high level anyway.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用的是网站(通过“文件”->“创建网站”创建),那么您没有使用项目。与 Visual Studio 中的所有其他项目类型不同,网站没有项目文件,并且直到运行时才真正构建。
If you're using a web site (created by File->Create Web Site), then you are not using a project. Unlike every other project type in Visual Studio, web sites don't have project files, and don't actually build until runtime.