Having issues with hot reloading and locked DLLs
See original GitHub issueDescribe the bug
I can’t seem to get hot reloading to work. The plugin DLLs are locked by dotnet.exe even with EnableHotReload = true
.
The hot-reload sample in this repository yielded the same results.
Using .NET Core SDK v3.1.100 on Windows.
To Reproduce Steps to reproduce the behavior:
- Install .NET Core SDK v3.1.100 on Windows
- Clone this (DotNetCorePlugins) repository
- Run
/samples/hot-reload/run.sh
- Output:
run.sh: Use CTRL+C to exit
TimestampedPlugin: this plugin was compiled at 9:05:24 a.m.
run.sh: Rebuilding plugin...
C:\Program Files\dotnet\sdk\3.1.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(155,5): warning MSB3026: Could not copy "C:\Source\DotNetCorePlugins\.build\obj\TimestampedPlugin\Debug\netstandard2.0\TimestampedPlugin.dll" to "C:\Source\DotNetCorePlugins\samples\hot-reload\bin\plugins\TimestampedPlugin\TimestampedPlugin.dll". Beginning retry 1 in 1000ms. The process cannot access the file 'C:\Source\DotNetCorePlugins\samples\hot-reload\bin\plugins\TimestampedPlugin\TimestampedPlugin.dll' because it is being used by another process.
Expected behavior The plugin DLL is successfully overwritten and the PluginLoader gets reloaded.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Testing Hot-Reload DLL on Windows
It turns out hot-reload C/C++ is not that trivial on Windows as the PDB file is locked. And I found this approach of...
Read more >Problem with hot-reloading code(dll)
I try do hot-reloading as casey in early episodes but I got problem. I do unload and load dll when my project compiled...
Read more >Output DLL becomes locked when UI Debugging Tools for ...
I have faced this issue when I used XAML hot reload for a long time. I closed VS, removed bin, obj folders but...
Read more >Anyone else having huge problems with VS 2022 and Hot ...
During debugging, I often get VS telling me that I have made changes to the code and that I have to stop debugging...
Read more >Hot Reload doesn't work when changes are made in VS ...
The best solution in this case would be to close the editor and compile from Visual Studio which should flush any old hot...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m on Win10 / VS2019 - does that fit? Think I’m gonna try the sample later. We will see…
This may occur in many circumstances. Even an open explorer.exe pointing to that directory may have a lock on files. I think there are some tools like sysinternals process explorer, which can show you who’s locking the file.