Search code examples
c#wpf

resource directory not found when it does exist


as you can see the resource directory does exist, on line 15 I had the same trouble but I fixed that one by deleting and reading I have tried it with this one but no working

[


Solution

  • The way files are recognized in xaml depends on them being properly included in the csproj file. The file showing up in solution explorer sometimes doesn't mean they are properly added to the project (say, you have "Show All Files" selected).

    To ensure files are properly added, you can right click on a file and select "include in project".

    In addition to that, it is also important to see whether or not the file is added with the proper build action. To be sure that the new xaml will work, try comparing how it is added to the csproj with another one of the files that is currently working. If it has any special build action, you'll be able to tell there and you can use the same build action for including the new one.