Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
398 views
in Technique[技术] by (71.8m points)

visual studio 2019 - MSBuild copying a DLL from a project directory which is set to Do Not Copy

I have a C# project which has a directory that is just for carrying some DLLs not meant to be copied into the project's OutputPath when the project is built.

The DLLs are added to the csproj and reside inside a folder in the project. The Build Action is set to None and Copy to Output Dir is set to Do not copy.

When I build my project, I see the DLL appearing in my output directory which is bin/Debug

Here is what I have tried

  1. I tried to set the Build Action to Content. Still copies.
  2. I deleted the DLLs, just to make sure they aren't coming from elsewhere, they do not get copied. So the source is that one directory in project.

I am using VS2019 to build, what am I missing?

question from:https://stackoverflow.com/questions/65948591/msbuild-copying-a-dll-from-a-project-directory-which-is-set-to-do-not-copy

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try these:

1) first, delete the dlls and the folder of the Dlls, also make sure that you have not installed any related nuget packages and referenced any related projects.

2) close VS ,delete .vs hidden folder, bin and obj folder.

3) restart VS and your project, then readd the dlls and try again.

If the issue still persists, please try to create a new project to test it or share a small sample with us to troubleshoot the issue.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...