question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Having issues with hot reloading and locked DLLs

See original GitHub issue

Describe 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:

  1. Install .NET Core SDK v3.1.100 on Windows
  2. Clone this (DotNetCorePlugins) repository
  3. Run /samples/hot-reload/run.sh
  4. 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:closed
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Andale-onlinecommented, Dec 9, 2019

I’m on Win10 / VS2019 - does that fit? Think I’m gonna try the sample later. We will see…

1reaction
Andale-onlinecommented, Dec 8, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found