error MSB3021: Unable to copy file
See original GitHub issue/usr/share/dotnet/sdk/2.0.2/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Publish.targets(109,5): error MSB3021: Unable to copy file . . .
. . . . Could not find a part of the path . . .
# dotnet --info
.NET Command Line Tools (2.0.2)
Product Information:
Version: 2.0.2
Commit SHA-1 hash: a04b4bf512
Runtime Environment:
OS Name: debian
OS Version: 9
OS Platform: Linux
RID: linux-x64
Base Path: /usr/share/dotnet/sdk/2.0.2/
Microsoft .NET Core Shared Framework Host
Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
MSBuild error MSB3021: Unable to copy file. Could not find ...
If your Build is being ruined by MSB3021, start with checking your antivirus settings. Mine has a feature called Real-time file system ...
Read more >How to kill the process causing the "MSB3021 Unable to copy ...
Open a command prompt as admin. You'll need an elevated command prompt. · Taskkill time! Run this in the command prompt: · Debug...
Read more >Error MSB3021 Unable to copy file - Developer Community
Based on the error message, the application itself is still running and holding a lock on the .exe file. See this message: The...
Read more >MSBuild error MSB3021: Unable to copy file ... - YouTrack
The exact error seems like it is trying to copy a file that does not exist yet. Like its accessing a DLL from...
Read more >Error MSB3021 Access to the path 'EpicGames.Core.dll' is ...
Try to delete the .dll files motioned in Build Output panel. For example, we have Unable to copy file "UnrealEngine\Engine\Source\Programs\ ...
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 FreeTop 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
Top GitHub Comments
@alvarollmenezes Just delete bin/Debug/ folder(s) before you build .NET Core assemblies. In my case I build using npm script and the script looks like this:
"build:linux:service:dev": "rm -r -f ../bin/deb/core/linux-x64/ && dotnet publish ../EveHQ-NG.sln --runtime linux-x64 --configuration Debug --self-contained",
You can see it in this file: project.jsonI experienced this problem as well, and solved it by using correct casing for filenames
E.g. there was a folder
wwwroot/Scripts
buttsconfig.json
had"outFile": "wwwroot/scripts/foo.js"
. Changing the outfile directory to capital S fixed it.