I've noticed that when developing an user control in vs2008, that I hav开发者_如何学Ce to build the user control each time I want to see the changes that I've made. Changes that usually doesnt requiere that I build the project aren't visible until I compile and build the project. This mean that it take a lot more time to develop since the site takes time to start up.
I've noticed that if the same kind of changes are made in a .aspx page, that I dont need to build the project to see the differences.
Why does this occur and is there any kind of workaround this besides putting all the code in the pages insted of the user control?
Best regards, Daniel
Basically this occurs if the changes you are making are to code which is compiled at build-time rather than run-time. If you are working on a web application all server side code is compiled at build time while all inline aspx code is compiled at runtime.
During development of web software this is generally a good thing as any build errors are highlighted before the application is deployed and compilation doesn't have to happen on the server at first load.
A possible workaround is to develop your control in a "Web Site" rather than a "Web Application" as this compiles each page and control seperatley at runtime rather than compiling the whole application into one dll at build time.
This article explains the difference between the "Web application project" and "Web site" models quite briefly
精彩评论