locked
Visual Studio Won't Accept Some Of My Controls

    Question

  • I have several controls in my XAML, all of which derive from the same base. The only difference between them is a few simple properties (what text is displayed, what colors are used, just basic stuff). Visual Studio is perfectly happy with some of the controls, but for others it gives me the following error:

    Error 26 The text associated with this error code could not be found.

    Cannot find a Resource with the Name/Key OverPathStyle [Line: 11 Position: 9] C:\Users\Nathan\Documents\Visual Studio 2013\Projects\W81Testing\KnotWhatYouWantTest\MainPage.xaml 48 3 KnotWhatYouWantTest

    The app compiles and runs exactly as I expect, but I would like to have it not give me an error (unless there really is one). You will notice that the error says it cannot find a resource, but I do not use that resource. I did a search for it, and it found 0 results (which means my code does not ask for it, since I set search for all files of all types), and it is certainly not asked for on the line mentioned in the error. I tried deleting all the files from the bin and obj directories so they could be regenerated, but it did not help. Why is Visual Studio 2013 complaining about some of the controls but not others if the app runs perfectly and the controls are virtually the same? Thanks.


    Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

    Friday, May 30, 2014 1:49 AM

Answers

  • If you clean the project/solution, close all documents in the editor and then rebuild - does the error remain?

    Sometimes I get this same error if I copy classes, edit code and then rebuild while editing.  The error doesn't show up again when I force VS to rebuild it's XAML cache (or whatever the mechanism is...)


    Darin R.

    Friday, May 30, 2014 5:56 PM

All replies

  • If you clean the project/solution, close all documents in the editor and then rebuild - does the error remain?

    Sometimes I get this same error if I copy classes, edit code and then rebuild while editing.  The error doesn't show up again when I force VS to rebuild it's XAML cache (or whatever the mechanism is...)


    Darin R.

    Friday, May 30, 2014 5:56 PM
  • Thank you, once I did the Clean Solution and closed/reopened the page it accepted all of the controls. Thanks.

    Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

    Friday, May 30, 2014 9:41 PM