Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autogenerated IntermediateOutputPath in the .csproj file

After updating the code from Git I have an error in the csproj, because the file path doesn't exist. Here is the code which initiates the error:

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ZAL_Release|x64'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>..\Release\bin\soft\</OutputPath>
    <DefineConstants>TRACE;ZAL</DefineConstants>
    <DebugType>full</DebugType>
    <PlatformTarget>x64</PlatformTarget>
    <ErrorReport>prompt</ErrorReport>
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
    <Optimize>true</Optimize>
    <IntermediateOutputPath>C:\Users\HARRY~1\AppData\Local\Temp\vs543E.tmp\x64\ZAL_Release\</IntermediateOutputPath>
</PropertyGroup>

This filepath exists on Harry's computer, but not on mine. The guy with this name has no idea how he created this, so I assume Visual Studio created it. That's why I have three questions:

1. What's the goal of IntermediateOutputPath tag in the csproj? (I already checked MSDN documentation, but still not clear)

2. How did Harry generat the code (because he doesn't know)?

3. Is it possible to use a generic variable to get a file path that everybody could use? In the case, is this IntermediateOutputPath mandatory for the program to run?

like image 777
Hans Avatar asked Mar 10 '17 05:03

Hans


People also ask

What is IntermediateOutputPath?

The IntermediateOutputPath. The full intermediate output path as derived from BaseIntermediateOutputPath, if no path is specified. For example, \obj\debug. If this property is overridden, then setting BaseIntermediateOutputPath has no effect. You can read this up here.

What does .csproj mean?

Files with CSPROJ extension represent a C# project file that contains the list of files included in a project along with the references to system assemblies.

How do you open the .csproj file?

CSPROJ files are are meant to be opened and edited in Microsoft Visual Studio (Windows, Mac) as part of Visual Studio projects. However, because CSPROJ files are XML files, you can open and edit them in any text or source code editor.

What is Csproj file used for?

csproj file to determine the packages to install from Nuget. To compile an ASP.NET application, the compiler needs information such as the version of the dotnet framework, the type of the application, etc. A . csproj file stores all this information that allows dotnet to build and compile the project.


1 Answers

  1. An OutputPath in your project file

    Specifies the path to the output directory, relative to the project directory, for example, "bin\Debug".

    The BaseOutputPath

    Specifies the base path for the output file. If it is set, MSBuild will use OutputPath = $(BaseOutputPath)\$(Configuration). Example syntax: c:\xyz\bin\

    The BaseIntermediateOutputPath

    The top-level folder where all configuration-specific intermediate output folders are created. The default value is obj. The following code is an example: c:\xyz\obj\

    The IntermediateOutputPath

    The full intermediate output path as derived from BaseIntermediateOutputPath, if no path is specified. For example, \obj\debug. If this property is overridden, then setting BaseIntermediateOutputPath has no effect.

    You can read this up here. In general these Paths should be relative and in no way lead to any home folders or other user-specific paths.

  2. See this question for an explanation of how the IntermediateOutputPath may have been inserted in your csproj file.

    EDIT: Actually, this is a vague explanation, but I could not find any other info about this. Keep an eye on changes on your csproj file to pin down the reason for the change.

  3. You can set IntermediateOutputPath to a relative path. You can, however, also just delete the whole tag and go with the default. In our Visual Studio 2015 project files, we only set the base OutputPath, and everything is working fine. I think the default place for your intermediate objects is /obj.

like image 143
kowsky Avatar answered Oct 18 '22 03:10

kowsky