Move obj folder in Visual Studio 2012

2019-01-25 03:10发布

Because the path becomes too long (more than 260 chars), I need to create obj folder elsewhere.

How can I tell VS 2012 to create this folder in a specified path?

2条回答
小情绪 Triste *
2楼-- · 2019-01-25 03:30

You'll need to edit the project file (XML) to specify the <BaseIntermediateOutputPath>. This value defaults to obj\.

<PropertyGroup>
  <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
  <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
  ...
  <BaseIntermediateOutputPath>some\path\</BaseIntermediateOutputPath>
</PropertyGroup>
查看更多
家丑人穷心不美
3楼-- · 2019-01-25 03:52

...And (in addition to Sam Harwell) You can use constants and can change any particular <PropertyGroup/> (only "release" for example) this way:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
  <Optimize>true</Optimize>
  .....
  <OutputPath>\your_projects\bin\$(SolutionName)\$(MSBuildProjectName)\$(Configuration)\</OutputPath>
  <IntermediateOutputPath>\your_projects\obj\$(SolutionName)\$(MSBuildProjectName)\$(Configuration)\</IntermediateOutputPath>
  <DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
查看更多
登录 后发表回答