在Visual Studio中为项目创建一个目标OBJ文件夹 [英] creating a targeted OBJ folder for a project in Visual Studio

查看:721
本文介绍了在Visual Studio中为项目创建一个目标OBJ文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以创建一个目标OBJ文件路径,就像你可以做一个BIN文件夹?您可以在项目的属性中设置输出路径。示例路径为:
Bin \Debug\Windows Phone 7 \
Bin \Debug\NETMF\
Bin \Debug .... \

Is it possible to create a targeted OBJ file path much like you can do for a BIN folder? You can set the output path in the Project's properties. Example paths would be: Bin\Debug\Windows Phone 7\ Bin\Debug\NETMF\ Bin\Debug....\

这里的一个用例是如果我有多个项目针对不同的平台。在编译时,OBJ文件是共享的而不是像bin文件夹那样分开。在编译时,你打的竞争条件下,OBJ文件夹被同时利用和错误抛出。

A use case here is if I have multiple projects that target different platforms. On compiling, the OBJ file is shared instead of separated out like the bin folders are. When compiling, you hit race conditions where the OBJ folder is being leveraged at the same time and errors are thrown.

推荐答案

说到MSBUILD,你可以选择在你的项目中设置 BaseIntermediaryOutputPath 。如果使用XML编辑器打开项目(.csproj,我假设),您将看到不同调试/发行配置组合的配置块。

Here we're talking about MSBUILD, and you have the option of setting BaseIntermediaryOutputPath in your project. If you open the project (.csproj, I am assuming) with an XML editor, you will see configuration blocks for different debug/release config combos.

(分别为每个配置选项编辑):

So something like this (edit for each config option separately):

<PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{A35097D8-80BC-4FA5-BECD-FF045C5566EC}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>WorkApplication</RootNamespace>
    <AssemblyName>WorkApplication</AssemblyName>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <BaseIntermediateOutputPath>E:\OBJ-TEST</BaseIntermediateOutputPath>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>

这篇关于在Visual Studio中为项目创建一个目标OBJ文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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