开发者

Rules for when .NET referenced assembly is put in bin\debug

开发者 https://www.devze.com 2022-12-18 00:01 出处:网络
How does .NET (or Visual Studio) build decide whether or not to copy a referenced assembly to your bin/debug or bin/release directory?(This is an .exe console program.)

How does .NET (or Visual Studio) build decide whether or not to copy a referenced assembly to your bin/debug or bin/release directory? (This is an .exe console program.)

On my machine, I had the referenced assembly in the GAC. A co-worker copied my bin/release to their machine, and it wouldn't run because the referenced asssembly was not in t开发者_C百科he bin/release (and not on their GAC).

Thanks,

Neal Walters


If the assembly is not in GAC, then its copied. The CopyLocal attribute in properties window, tells if the assembly will be copied or not.


When you have added a reference to a project (Project->Add Reference... or in Solution Explorer right click References and select Add Reference...) you can right click the added references and select Properties. You will then see the CopyLocal property in the properties window. This can be set to True or False to indicate weather the reference needs to be copied to the output directory of the project.

0

精彩评论

暂无评论...
验证码 换一张
取 消