Visual Studio 2008中 - 在构建移动文件斌/ [英] Visual Studio 2008 - Moving files at build to bin/

查看:172
本文介绍了Visual Studio 2008中 - 在构建移动文件斌/的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑:这是用C#编写一个VS2008应用

所以,我有我的解决方案称为一个文件夹

So I have a folder in my solution called

_lib/ 

这也正是我把我的DLL,这样,当我引用它们,它们就内置在斌/ 文件夹中。

It's where I keep my DLLs so that when I reference them, they get built into the bin/ folder.

现在,我在我的解决方案的新项目。这是一个DLL,但不应该是引用(必须为第三方应用程序)。所以,在构建我想这是从 _lib / 复制到斌/ 但不是在项目中引用。

Now I have a new item in my solution. It's a DLL but shouldn't be reference (it's required for a 3rd party app). So on build I want this to be copied from _lib/ to bin/ but NOT referenced in the project.

我包括我的应用程序的 _lib / 文件夹,该DLL的属性,我选择总是复制。这几乎工作,它拷贝文件与文件夹,所以我的结构是这样的:

I've included the _lib/ folder in my app, and for the properties of that DLL I selected always copy. This ALMOST worked, it copies the file with the folder, so my structure looks like:

/bin/_lib/thedll.dll

而不是

/bin/thedll.dll

任何想法?

推荐答案

尝试以下在Visual Studio下列步骤操作:

Try following these steps in Visual Studio:


  • 展开有关项目树

  • Expand the project tree concerned

双击属性元素

在打开的窗口中点击生成事件设置页

In the opened window click the Build Events tab

生成后事件命令行文本区位这样的:

xcopy "$(ProjectDir)_lib\file.ext" "$(ProjectDir)bin\$(ConfigurationName)"


  • 打开旁边的Visual Studio

  • Open the expected output folder alongside Visual Studio

    按<大骨节病> CTRL + <大骨节病>移 + <大骨节病>乙,以确保所有内容将保存并建立

    Hit CTRL+Shift+B to make sure everything is saved and build

    感受到成就感涌上里面你作为出现在您的文件

    Feel the sense of achievement well up inside you as your file appears

    :)

    哦,您现在可以设置复制到输出目录不要复制

    Oh, and you can now set Copy to output directory to Do not copy.

    这篇关于Visual Studio 2008中 - 在构建移动文件斌/的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆