dotnet / dotnet/wpf

Unknown build error, 'An item with the same key has already been added.' IOException: Cannot locate resource

Open
#10,971 2 comments 0 reactions 0 assignees View on GitHub
:mailbox_with_no_mail: waiting-author-feedback Investigate Needs minimal repro project
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

_This issue has been moved from [a ticket on Developer Community](https://developercommunity.visualstudio.com/t/Unknown-build-error-An-item-with-the-s/10932847)._

---
[severity:It's more difficult to complete my work]
Working on WPF .NET 9 application and getting this error on first compile after editing source code, no error if I rebuild it for the second time. VS 2022 Pro.
But, after running the solution, program failed with code:
System.Windows.Markup.XamlParseException: ''Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '67' and line position '14'.'
Inner Exception
IOException: Cannot locate resource 'assets/toolbaricons/refresh.png'.

[DictionaryPage.xaml](https://aka.ms/dc/file?name=B9ab070768b6f480eb506a7f721d6ff2c638873401930727107_DictionaryPage.xaml&tid=9ab070768b6f480eb506a7f721d6ff2c638873401930727107)
[DictionaryPage.xaml.cs](https://aka.ms/dc/file?name=Bd37888d35b1d43f0bf7df253705ec0ed638873402063719847_DictionaryPage.xaml.cs&tid=d37888d35b1d43f0bf7df253705ec0ed638873402063719847)
[DictionaryViewModel.cs](https://aka.ms/dc/file?name=B0e5e09c4828447009a8c07e63b90c554638873402251480310_DictionaryViewModel.cs&tid=0e5e09c4828447009a8c07e63b90c554638873402251480310)
[Instructors.csproj](https://aka.ms/dc/file?name=Bc0d1ab4d5cf34352bd591a1234bef5cc638873402605232327_Instructors.csproj&tid=c0d1ab4d5cf34352bd591a1234bef5cc638873402605232327)
![Asset Folder.jpg](https://aka.ms/dc/image?name=B53a5e476d67844d18ea6df40d4b56c7c638873405533238223_Asset_Folder.jpg&tid=53a5e476d67844d18ea6df40d4b56c7c638873405533238223)

---
### Original Comments

#### Feedback Bot on 7/7/2025, 03:19 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.