5

I have a main project (ProjectA) that contain a base class (xaml + code-behind).
Also, I have another project (ProjectB) in reference with ProjectA. In that last project I have inherits some user-control created in ProjectA.

When launching the main application, I receive the follow error:

The component 'XXX' does not have a resource identified by the URI  
'/My.Assembly;component/.../simplegridview.xaml'

Is there a best way to resolve that problem?

H.B.
  • 166,899
  • 29
  • 327
  • 400
Alberto
  • 77
  • 7
  • +1 Was facing the exact same problem this week. I'm quite new to WPF though, so wouldn't dare post this as an answer yet, but for what it's worth: For now we did this (in code behind, because the case required us to do so) by replacing "My.Assembly" with `this.GetType().Assembly.FullName` in the base method (which grabs the assembly from the *inheriting* type). – Jeroen Aug 22 '12 at 06:49
  • In file simplegridview.g.cs, there is a definition of URI specification but if I try to change a value, the compiler overwrite my changes. But It's so difficult manage the inherits on WPF ? – Alberto Aug 22 '12 at 07:20
  • just curious, why not create a Common.dll containting common controls and reference it in ProjectA and ProjectB? – denis morozov Jun 04 '13 at 16:14
  • See similar question: http://stackoverflow.com/questions/7646331/the-component-does-not-have-a-resource-identified-by-the-uri – aliceraunsbaek Aug 14 '13 at 05:36

2 Answers2

2

I know it is not really a solution to the problem. But I have found that Clean and Build makes the error go away...

aliceraunsbaek
  • 625
  • 7
  • 18
  • This is useful if you've gotten your app to build once before, and no code has changed in this area. I'll give this a shot. It's amazing how many things get fixed by "clean then rebuild" :) – C. Tewalt Aug 19 '13 at 17:58
0

I encounter the same problem with VS 2013 sometimes, without any immediate cause e.g. after a reboot and rebuild from scratch. In such cases the solution build succeeds, it also runs but still the error list displays e.g. 5 URI errors. While sometimes clean and build suffies, other times you have to close VS, delete bin/obj folders of the project with the errors, reopen VS and then the errors have gone.

Gerard
  • 13,023
  • 14
  • 72
  • 125