Questions tagged [copy-local]

26 questions
83
votes
7 answers

When should copy-local be set to true and when should it not?

I am wondering if there are any heuristics for when to set copy-local=true for references? If referenced types are only used internally can I set copy-local to true but if referenced types are exposed as parameters or return values I set copy-local…
Fadeproof
  • 3,038
  • 5
  • 31
  • 42
67
votes
5 answers

Set content files to "copy local : always" in a nuget package

I generate a nuget package from a project with this command in the post-build event. the variable %conf% is set to the right configuration (debug or release) and %1 is the project name (e.g. "MyCompany.MyProject"). nuget pack -Prop…
Johnny5
  • 6,664
  • 3
  • 45
  • 78
62
votes
1 answer

MSBuild ProjectReference:private ("Copy Local") - what are the allowed values and behaviour?

TL;DR Is there any official documentation that describes in detail how the / "Copy Local" option works with MSBuild? And what values are supposed to go into it? When you add a project reference from one project in Visual Studio to…
Martin Ba
  • 37,187
  • 33
  • 183
  • 337
39
votes
6 answers

Set "Copy Local" to False by default?

Can I set the default-option of "Copy Local" in Visual Studio to False? In most times, when I add a dll as dependency of a project, I want the Copy Local property set to False. Per default, it is True. Is there a way to change the default behaviour…
dr pain
  • 570
  • 1
  • 5
  • 13
31
votes
2 answers

Is "Copy Local" transitive for project references?

Wrt. the proposed dupe: Since this here queston suggests the opposite of the linked question, I'd rather like to think it is not a dupe. First, I did read What is the best practice for “Copy Local” and with project references? (also this) and I'll…
Martin Ba
  • 37,187
  • 33
  • 183
  • 337
11
votes
1 answer

VS 2015 copies to output GAC references of a project reference regardless of copy local setting

I've raised a connect issue for that behavior. VS 2015 copies to output GAC references of a project reference regardless of copy local setting. VS 2010 doesn't do that with the same solution & projects, respecting the copy local property. The only…
vezenkov
  • 4,009
  • 1
  • 26
  • 27
11
votes
2 answers

Assembly only used in XAML is not copied to bin folder

In WPF project, references only used in xaml is not copied to bin folder even with CopyLocal set to true, as complained in this post. With MVVM pattern, it is common that 3rd party controls are used with no code-behind references at all. Inspired by…
NS.X.
  • 2,072
  • 5
  • 28
  • 55
8
votes
4 answers

How to get Visual Studio to stop copying DLLs during build without my permission?

I have a Visual Studio project that relies on several DLL references. Here is a sample of those references in my csproj: False
Gabe Sumner
  • 4,978
  • 6
  • 33
  • 43
8
votes
2 answers

how to make a Visual Studio project file to copy indirect references?

As the screenshot shows, ClassLibrary1 relies on ClassLibrary2 and ClassLibrary2 relies on ClassLibrary3. And "Copy Local" is set to be "True". But when I compile ClassLibrary1, ClassLibrary3 won't be copied to the bin folder. So how can I config…
6
votes
3 answers

Copy local and system dlls' - what is the point?

Visual studio by default copies all dlls' to each project's bin folder. This also includes system dlls' (with the exception of mscorlib.dll and System.dll), such as System.Xml.Linq, System.ComponentModel.Composition (included since SL4) etc. Since…
Blake Pettersson
  • 8,927
  • 3
  • 27
  • 36
4
votes
2 answers

How should I determine which are the references that has to be "copied locally"?

Many similar posts but this is not a duplicate I believe. When I add references in visual studio, some dlls are copied locally while some not. I understand that the external dlls I get from elsewhere should have a local reference, but then I…
nawfal
  • 70,104
  • 56
  • 326
  • 368
4
votes
1 answer

Suppress XML File Generation For 3rd Party DLLs When Building Solution

Okay, I figured how to disable XML file generation for my own project (Compile -> Generate XML documentation file). There are also some 3rd party DLLs with Copy Local = True, which I need for XCopy deployment. Each of them creates their own XML in…
Victor Zakharov
  • 25,801
  • 18
  • 85
  • 151
3
votes
1 answer

Referencing dlls without copying them C#

When we create a new C# project and reference a dll, the dll is copied to the project's output directory when compiling the project. Is there a way of referencing dll files and not copying them to the project's output directory, and have the…
Idanis
  • 1,918
  • 6
  • 38
  • 69
3
votes
3 answers

Copy local = false file not found exception issue

Hi I know this has been asked but it did not get an answer. I have a problem when I want to use a dll that is installed on C:\Program files (x86)\Dummu_API.dll When I run my app it throws exception: Could not load file or assembly 'Dummy_API,…
Yoiku
  • 882
  • 2
  • 13
  • 25
2
votes
2 answers

Microsoft.Owin.Host.HttpListener isn't being copied to a referencing projects' build output

I am referencing a one project in Visual Studio solution from another project in the same solution. The project being referenced (Project B) has Microsoft.Owin.Host.HttpListener nuget package and so the .dll referenced in it. The project that is…
Maxim V. Pavlov
  • 10,303
  • 17
  • 74
  • 174
1
2