tags:

views:

19

answers:

1

I have a Silverlight 3 App that became quite big over the time. So I began to try to break it in several smaler Applications that will be dynamically loaded in my Main Application on demand. But I run into a strange problems with my VS 2008. When I add a new Silverlight Application project to my solution and copy User Controls from my old Main Application into this new project it happens from time to time (about twice a day) that the XAML files and their code behind files loose their association. When this happens and I try to build the project, the compiler complains that he cannot find all the Ccontrols like buttons, labels etc. in the code behind files that I added to the class in the XAML-file. And the build fails of course.

The only workaround that I found so far is to add another Silverlight Application project and move all the content from the first added project to it. Than everything works fine for a while until the problem occurs again. But that's not really a solution.

Any Ideas what happens here and what i can do?

Best Regards, Rocko

+1  A: 

I have seen issues like this before when changing the namespaces on controls in silverlight. The issue crops up when you don't change both the namespace on the control class, and the full name of the class in the x:class attribute on the root element of the control.

Not sure if this fits your situation or not, but it's the only time I've run into similar issues.

ckramer
This might fit my situation. The new project has of course its own namespace and so I have to change the namespaces of all the copied classes and controls. And since I cannot change the namespace in the code behind and in the XAML simultaneously, there are always moments when the namespaces differ...
Rocko
I actually ran into this once doing renaming of controls with a refactoring tool...took me way too long to figure out what was going on. Hope this points you in the right direction.
ckramer