dotnet / upgrade-assistant

A tool to assist developers in upgrading .NET Framework applications to .NET 6 and beyond
MIT License
1.11k stars 163 forks source link

KeyNotFoundException System.ComponentModel.Annotation #946

Open bswift-kj opened 2 years ago

bswift-kj commented 2 years ago

Describe the bug

We are trying to upgrade some class libraries, currently built in .NET Framework 4.7.2, and will occasionally get a KeyNotFound Exception that references System.ComponentModel.Annotations. However this reference is not located in this project. We are not sure why this is happening. We have spoken with Microsoft and they recommended that I ask here. I am happy to provide the .csproj file and .clef files if requested, but does not look like I can upload it here. project_references

To Reproduce

Can supply project files if requested.

Exceptions (if any)

Annotation Error

Further technical details

Thank you for your help.

sunandabalu commented 2 years ago

@bswift-kj Could you please provide the .csproj file you are using and also the .clef file for logs? If you are unable to upload here, feel free to email to dotnetupgradeassist@microsoft.com

bswift-kj commented 2 years ago

I am unable to upload or email that emails address (RESOLVER.RST.SenderNotAuthenticatedForGroup; authentication required; Delivery restriction check failed because the sender was not authenticated when sending to this group).

zdzdz commented 2 years ago

I'm experiencing absolutely the same issue. I follow the guide from the documentation https://docs.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-aspnetmvc with absolutely freshly created MVC project (.net 4.5.2). I run the upgrade-assistant and second step that converts the project file fails with 'Unexpected error applying step System.Collections.Generic.KeyNotFoundException: The given key 'System.ComponentModel.Annotations' was not present in the dictionary.'

I even excluded 'System.ComponentModel.DataAnnotations' and still same result.

Natis88 commented 2 years ago

any solution for this problem?

sgalcheung commented 1 year ago

Recently, I also meet the same issue, and found a relation issue

sgalcheung commented 1 year ago


This solved my issue