I'm new about code developing with Visual Studio 2010 and I would like to ask you a simple question about something after build a project.
我是关于使用Visual Studio 2010开发代码的新手,我想在构建项目之后向您询问一个关于某事的简单问题。
I have a C# project and when I build It in Release mode some file are created and some of them copied from another in to \output\bin\Release\ folder. My question is that How can I manage that which created dll or created file will be in \output\bin\Release\ folder.
我有一个C#项目,当我在发布模式下构建它时,会创建一些文件,其中一些文件从另一个文件复制到\ output \ bin \ Release \文件夹中。我的问题是如何管理创建的dll或创建的文件将在\ output \ bin \ Release \文件夹中。
I tried to take a look at build properties of project but I could not find any option about it.
我试着看看项目的构建属性,但我找不到任何关于它的选项。
Thank you.
2 个解决方案
#1
0
Actually I do not need this dll in my project output folder because I add this dlls as a reference to my project
实际上我在我的项目输出文件夹中不需要这个dll,因为我添加了这个dll作为我的项目的参考
And this is exactly why this file appear in output folder.
这正是此文件出现在输出文件夹中的原因。
There are several ways to "put" file in output folder. For normal files in the project you can set property Copy to Output Directory
.
有几种方法可以将“放置”文件放在输出文件夹中。对于项目中的普通文件,您可以将属性Copy设置为Output Directory。
If we talking about dll's, (as mentioned Hans), there is Copy Local
property for each assembly in References.
By default VS set this according to our GAC, so if you are using 3rd part assembly or from another project VS will set this property to True
and file will be copied to output folder.
如果我们谈论dll,(如提到的Hans),References中的每个程序集都有Copy Local属性。默认情况下,VS根据我们的GAC设置它,因此如果您使用第三方组件或从另一个项目VS将设置此属性为True,文件将被复制到输出文件夹。
If you don't want to put this file in output folder, just set this property to False
. But remember, at run time this assembly should exist.
如果您不想将此文件放在输出文件夹中,只需将此属性设置为False即可。但请记住,在运行时,这个程序集应该存在。
For more information: How to: Set the Copy Local Property of a Reference
有关更多信息:如何:设置引用的复制本地属性
Another explanation: you just messed up with Output path
in the project properties and two project has the same output folder. :)
另一种解释:你刚刚搞砸了项目属性中的输出路径,而两个项目有相同的输出文件夹。 :)
#2
0
I suggest that you ignore the extra files that are created. One way to do this is to configure the destination of these to a different location.
I use this:
我建议你忽略创建的额外文件。一种方法是将这些目标配置到不同的位置。我用这个:
property pages->General
- Output Directory = $(SolutionDir)..\link\
- Intermediate Directory = c:\temp\vc10\$(SolutionName)\$(Configuration)\
属性页 - >常规 - 输出目录= $(SolutionDir).. \ link \ - 中间目录= c:\ temp \ vc10 \ $(SolutionName)\ $(配置)\
Use the same settings for debug and release.
使用相同的设置进行调试和发布。
#1
0
Actually I do not need this dll in my project output folder because I add this dlls as a reference to my project
实际上我在我的项目输出文件夹中不需要这个dll,因为我添加了这个dll作为我的项目的参考
And this is exactly why this file appear in output folder.
这正是此文件出现在输出文件夹中的原因。
There are several ways to "put" file in output folder. For normal files in the project you can set property Copy to Output Directory
.
有几种方法可以将“放置”文件放在输出文件夹中。对于项目中的普通文件,您可以将属性Copy设置为Output Directory。
If we talking about dll's, (as mentioned Hans), there is Copy Local
property for each assembly in References.
By default VS set this according to our GAC, so if you are using 3rd part assembly or from another project VS will set this property to True
and file will be copied to output folder.
如果我们谈论dll,(如提到的Hans),References中的每个程序集都有Copy Local属性。默认情况下,VS根据我们的GAC设置它,因此如果您使用第三方组件或从另一个项目VS将设置此属性为True,文件将被复制到输出文件夹。
If you don't want to put this file in output folder, just set this property to False
. But remember, at run time this assembly should exist.
如果您不想将此文件放在输出文件夹中,只需将此属性设置为False即可。但请记住,在运行时,这个程序集应该存在。
For more information: How to: Set the Copy Local Property of a Reference
有关更多信息:如何:设置引用的复制本地属性
Another explanation: you just messed up with Output path
in the project properties and two project has the same output folder. :)
另一种解释:你刚刚搞砸了项目属性中的输出路径,而两个项目有相同的输出文件夹。 :)
#2
0
I suggest that you ignore the extra files that are created. One way to do this is to configure the destination of these to a different location.
I use this:
我建议你忽略创建的额外文件。一种方法是将这些目标配置到不同的位置。我用这个:
property pages->General
- Output Directory = $(SolutionDir)..\link\
- Intermediate Directory = c:\temp\vc10\$(SolutionName)\$(Configuration)\
属性页 - >常规 - 输出目录= $(SolutionDir).. \ link \ - 中间目录= c:\ temp \ vc10 \ $(SolutionName)\ $(配置)\
Use the same settings for debug and release.
使用相同的设置进行调试和发布。