【发布时间】:2018-07-21 13:30:45
【问题描述】:
在 .Net Standard 2.0 库项目中,直接为输出和中间文件指定自定义路径的正确方法是什么?
我尝试了以下配置,该配置适用于 .Net 标准库的早期版本。
请注意,这些路径是相对于项目的,我只是复制了在升级到 .Net Standard 2.0 之前工作的相同路径,此外,我从 IDE 设置窗口中输入的任何内容在保存到 .csproj 时都会转换为相对路径文件。
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<EnableDefaultEmbeddedResourceItems Condition=" '$(EnableDefaultEmbeddedResourceItems)' == '' ">false</EnableDefaultEmbeddedResourceItems>
<ProjectName Condition=" '$(ProjectName)' == '' ">MyLibrary</ProjectName>
<SolutionOutputPath Condition=" '$(SolutionOutputPath)' == '' ">..\..\..\..\..\..\tmp\com.company.myapp</SolutionOutputPath>
<BaseIntermediateOutputPath>..\..\..\..\..\..\tmp\com.company.myapp\MyLibrary\obj\Debug</BaseIntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<Optimize>false</Optimize>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<OutputPath>$(SolutionOutputPath)\$(ProjectName)\bin\$(Configuration)</OutputPath>
<BaseOutputPath>$(SolutionOutputPath)\$(ProjectName)\bin\$(Configuration)</BaseOutputPath>
<IntermediateOutputPath>$(SolutionOutputPath)\$(ProjectName)\obj\$(Configuration)</IntermediateOutputPath>
<BaseIntermediateOutputPath>$(SolutionOutputPath)\$(ProjectName)\obj\$(Configuration)</BaseIntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType></DebugType>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<OutputPath>$(SolutionOutputPath)\$(ProjectName)\bin\$(Configuration)</OutputPath>
<BaseOutputPath>$(SolutionOutputPath)\$(ProjectName)\bin\$(Configuration)</BaseOutputPath>
<IntermediateOutputPath>$(SolutionOutputPath)\$(ProjectName)\obj\$(Configuration)</IntermediateOutputPath>
<BaseIntermediateOutputPath>$(SolutionOutputPath)\$(ProjectName)\obj\$(Configuration)</BaseIntermediateOutputPath>
</PropertyGroup>
【问题讨论】:
标签: .net visual-studio xamarin.forms