开发者

Prevent designer class from being rebuilt

Is there any way that I can prevent a designer class from being rebuilt when running my project?

The designer class is a webservice reference w开发者_高级运维ith over 30000 lines of code and appears to be being rebuilt almost every time I run my project. (Which obviously takes quite some time)

Is there some explicit way I can prevent Visual Studio 2010 from rebuilding this class each time I run the project?


One obvious suggestion: put it in a different project, as a class library. Visual Studio should detect that nothing in that project has changed, and avoid rebuilding it.

I realise this is somewhat ugly, but it may be a reasonably practical approach. Of course if there are other types in the project which are related to the web service and which also don't change much, you could add them into the same project.

EDIT: While I don't think there's anything in the web service properties box about this, you might want to check it... and check whether the designer file itself is being regenerated. If for some reason it's fetching the metadata on every build (do you have any custom build rules?) that would quite possibly be the problem.


Have a look at the "Configuration Manager". It's under the menu item: Build -> Configuration Manager... It allows you explicitly disable which projects are build depending on the solution configuration.

Another option is to unload the project for the solution.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜