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

Categories

In visual studio, when you add a reference there is a flag in the properties called, "Copy Local". There is some confusion about what this actually does and when. It seems easy to understand but my question is when does it copy local. Is it when the reference is added or does it copy the dll locally when the project is built.

The reason for this question is we have created a asp.net template file that refences a dll that is on all of our devs local workstations in exactly the same place. We thought that by setting the flag to "Copy Local", this would reference the location where the dll lives but when we use the template, the reference is broken and needs to be re-added.

Can anyone shed some light on this?

See Question&Answers more detail:os

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

1 Answer

The Copy Local property determines whether a reference is copied to the local bin path. At run time, a reference must exist in either the Global Assembly Cache (GAC) or the output path of the project. If this property is set to true, the reference is copied to the output path of the project at run time.

So this property is actually not useful in your scenario.

I'm unable to suggest a better solution than adding the assembly to the GAC in each developer workstation: http://msdn.microsoft.com/en-us/library/yf1d93sz.aspx


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...