Because the path becomes too long (more than 260 characters), I need to create the obj
folder elsewhere.
How can I tell Visual Studio 2012 to create this folder in a specified path?
Delete bin and obj foldersThe bin and obj folders are usually safe to delete since they are automatically generated when the solution/project is being build by Visual Studio/MSBuild. This feature is off by default, but can easily be enabled in the settings.
In Visual Studio, click Tools > Options. Expand Projects and Solutions and click Locations. The Projects location field defines the default location for storing new projects. You can change this path if you are using a different working folder.
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>
...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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With