Hi @peter rumsey ,
Thank you very much for sharing the sample project.
I can reproduce this issue.
I notice that the hot reload issue you got is impacted by the configuration for AssemblyVersion property.
In AssemblyInfo.vb file, it was set to <Assembly:AssemblyVersion("2.0.*")>
(with <Deterministic> property set to false, in the .vbproj file).
By the way, the AssemblyVersion property can be set/checked by right-clicking the project > Properties > Application > Assembly Information > Assembly version.
After researching and analyzing, I doubt that this is a potential issue. I suggest you submit a ticket on our Developer Community(in VS, click Help > Send Feedback > Report a Problem) and direct report this issue to Visual Studio Product Team.
Currently, if you want to mitigate this issue, you can set and use a specific assembly version, instead of using wildcard *.
For example, changing 2.0.* to 2.0.0.0.
Update1:
Above is the direct cause, not the root cause.
Further tests show that even using .NET 9 projects, this issue persists.
As the error message shows very specific, I have reported this issue.
Here's the ticket link: The VB WinForm project shows ENC0005 error while debugging in VS 2022 and using hot reload. Kindly try to follow that ticket and wait for the latest information.
By the way, the "Restart Application" option is a little quicker for restarting the application in this situation.
Kind regards,
Tianyu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.