.csproj文件中的自动生成的IntermediateOutputPath [英] Autogenerated IntermediateOutputPath in the .csproj file

查看:86
本文介绍了.csproj文件中的自动生成的IntermediateOutputPath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从Git更新代码后, 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>

filepath 存在于Harry的计算机上,但不在我的计算机上.这个名字的家伙不知道他是如何创建的,所以我假设Visual Studio创建了它.这就是为什么我有三个问题:

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.. csproj 中的 IntermediateOutputPath 标记的目的是什么?(我已经检查了MSDN文档,但仍然不清楚)

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

2..Harry是如何生成代码的(因为他不知道)?

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

3..是否可以使用通用变量来获取每个人都可以使用的文件路径?在这种情况下,该 IntermediateOutputPath 是程序运行所必需的吗?

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?

推荐答案

  1. 项目文件中的 OutputPath

指定相对于项目目录的输出目录的路径,例如"bin \ Debug".

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

BaseOutputPath

指定输出文件的基本路径.如果设置,MSBuild将使用OutputPath = $(BaseOutputPath)\ $(Configuration).语法范例:c:\ xyz \ bin \

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

BaseIntermediateOutputPath

创建所有特定于配置的中间输出文件夹的顶级文件夹.默认值为obj.下面的代码是一个示例:c:\ xyz \ obj \

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\

IntermediateOutputPath

从BaseIntermediateOutputPath派生的完整中间输出路径(如果未指定路径).例如,\ obj \ debug.如果此属性被覆盖,则设置BaseIntermediateOutputPath无效.

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.

请参阅此问题,以获取有关 IntermediateOutputPath 可能是如何的解释.插入到您的csproj文件中.

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

实际上,这是一个模糊的解释,但是我找不到关于此的任何其他信息.密切注意csproj文件的更改,以查明更改的原因.

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.

您可以将 IntermediateOutputPath 设置为相对路径.但是,您也可以删除整个标签并使用默认标签.在Visual Studio 2015项目文件中,我们仅设置基本的 OutputPath ,并且一切正常.我认为中间对象的默认位置是/obj .

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.

这篇关于.csproj文件中的自动生成的IntermediateOutputPath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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