Windows Forms designer unable to load type from assembly 'Microsoft.VisualStudio.DesignTools.Interaction'

Viewed 119

I'm converting my .NET Framework 4.8 application to .NET 5, and have made it to the point where I'm able to build and run the application without issue, but when opening some of my User Controls in the Forms designer, I get a System.TypeLoadException with the following message:

Could not load type 'Microsoft.VisualStudio.DesignTools.Extensibility.Actions.SuggestedActionProvider' from assembly 'Microsoft.VisualStudio.DesignTools.Interaction, Version=16.9.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

Any ideas what could be causing this issue and how to get around it? I really need to be able to use the designer to maintain these forms, and was hoping the .NET 5 Forms support was strong enough at this point that I'd be able to migrate without running into too many difficulties.

1 Answers

You can try the following steps to migrate your .NET framework app to .NET 5 by using .NET Upgrade Assistant.

First, you can use the following command to install the Upgrade Assistant in the command line.

dotnet tool install -g upgrade-assistant

Second, please use the following command to navigate to the folder where the target project or solution is located.

upgrade-assistant D:\TestWinform\TestWinform.csproj

Third, you can following steps in the link Run upgrade-assistant.(Almost input 1 and Enter until the end)

Fourth, please reopen the initial project again after you complete the above steps.

Finally, you can see .NET 5 winform project has been migrated successfully.

Besides, based on my test, there is no errors for the UserControl for the migrated WinForm.

Related