How to automate project cleaning for WPF projects with windows and controls?
I have a single project with both WPF Window
s and UserControl
s. Whenever I make a change to both a UserControl
and to the Window
that uses it I can't run the project right away, it will throw exceptions at runtime. To solve those exceptions I have to Clean and Rebuild the开发者_JAVA技巧 project.
How to avoid this problem?
NB: I guess that if the controls were in a separate referenced project, they would be built first and the problem would be solved, but I don't want to create a second project.
The problem is not the build process. When you run your program, all the files in your project are compiled if any of them have been modified. It is true that you need to build your application for the changes to your user controls to show up in the Visual Studio designer of the windows that use them, but that's not the problem you are having.
The only odd thing is that you report than a clean and rebuild fixes your problem. There are a variety of possible explanations for this. You'll just have to use the debugger to try to find out why your program behaves differently in that situation.
精彩评论