DotnetCore project with changed IntermediateOutputPath - some Nuget Packages are lost

。_饼干妹妹 提交于 2019-12-11 14:18:41

问题


The question is related to DotnetCore project IntermediateOutputPath leaves some files in the solution directory

In order to move away all temporary folders (build and output) from the solution directory, the following modification to the .csproj file has been made

<Project>
 <PropertyGroup>
   <BuildDIrectory>C:\Temp\Build\$(Configuration)</BuildDIrectory>
   <BaseIntermediateOutputPath>$(BuildDIrectory)\obj\$(AssemblyName)\</BaseIntermediateOutputPath> 
   <OutputPath>$(BuildDIrectory)\out\$(AssemblyName)\</OutputPath>
   <DocumentationFile> $(BuildDIrectory)\Documentation\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup>
  <TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />

The problem happens with a specific Nuget Package - it is lost. I.e. when it is added, Solution Explorer/Project/Dependencies/Packages blinks and then disappears. If I try to use in the code classes defined in the Nuget Package, they are not recognized. Changing the first line back to the default

<Project Sdk="Microsoft.NET.Sdk">

loads the package immediately.

来源:https://stackoverflow.com/questions/58502644/dotnetcore-project-with-changed-intermediateoutputpath-some-nuget-packages-are

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!