Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

c# - visual studio copy local

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

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

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...