.csproj文件中的自动生成的IntermediateOutputPath

编程入门 行业动态 更新时间:2024-10-27 04:28:58
本文介绍了.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?

推荐答案

  • 项目文件中的 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 VisualStudio2015 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

    本文发布于:2023-11-05 19:31:09,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1561656.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:自动生成   文件   csproj   IntermediateOutputPath

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!