简体   繁体   中英

.NET WAP Publish Question - CodeFile included in publish

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应用程序项目,则aspx页面和ascx控件应在页面指令中使用CodeBehind而不是CodeFile属性。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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