开发者

How to migrate from BuildProvider to Web Application project?

Currently we have a bunch of web sites (web site projects) that I think should be converted to web application projects. Everybody agrees.

But a number of custom BuildProviders are used to generate controls and u开发者_运维技巧nfortunately MSDN says that

Adding a customized BuildProvider class to the Web.config file works in an ASP.NET Web site but does not work in an ASP.NET Web application project

Are there some ways to migrate though without full discarding of custom BuildProviders mechanism?


Without knowing exactly what your build provider do I can see two possible solutions:

  1. Custom MSBuild tasks
  2. T4 templates


Hey you need to implement, a custom IVsSingleFileGenerator. And register it with your VS, to generate a custom .designer-File. The way DesignTime-Compilation works changed with Web Application Projects.

In combination with a BuildProvider you will get the same as ASPX-Pages.

I used it to generate user-interfaces with partial-methods to implement behavior in a codebehind-file.


That's impossible without review of the whole approach.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜