Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Move obj folder in Visual Studio 2012 [duplicate]

Tags:

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?

like image 988
ff8mania Avatar asked Mar 25 '13 16:03

ff8mania


People also ask

Can I delete the OBJ folder Visual Studio?

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.

How do I change project location in Visual Studio?

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.


2 Answers

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> 
like image 54
Sam Harwell Avatar answered Oct 27 '22 19:10

Sam Harwell


...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> 
like image 42
Valikoo Vakh Avatar answered Oct 27 '22 18:10

Valikoo Vakh