Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntermediateOutputPath doesn't affect some NuGet related files #10333

Closed
tmds opened this issue Nov 30, 2020 · 2 comments
Closed

IntermediateOutputPath doesn't affect some NuGet related files #10333

tmds opened this issue Nov 30, 2020 · 2 comments
Labels
Functionality:Restore Resolution:ByDesign This issue appears to be ByDesign

Comments

@tmds
Copy link

tmds commented Nov 30, 2020

When setting IntermediateOutputPath, most files that are by default put under obj are placed at that location, except for some files that are NuGet related.

Reproducer:

$ dotnet new console -o console --no-restore

Add this to console.csproj:

    <IntermediateOutputPath>/tmp/intermediate</IntermediateOutputPath>

Now:

$ dotnet build

Most files moved to IntermediateOutputPath:

/tmp/intermediate/
└── net5.0
    ├── apphost
    ├── console.AssemblyInfo.cs
    ├── console.AssemblyInfoInputs.cache
    ├── console.assets.cache
    ├── console.csprojAssemblyReference.cache
    ├── console.csproj.CoreCompileInputs.cache
    ├── console.csproj.FileListAbsolute.txt
    ├── console.dll
    ├── console.GeneratedMSBuildEditorConfig.editorconfig
    ├── console.genruntimeconfig.cache
    ├── console.pdb
    └── ref
        └── console.dll

Some remained under obj:

obj/
├── console.csproj.nuget.dgspec.json
├── console.csproj.nuget.g.props
├── console.csproj.nuget.g.targets
├── project.assets.json
└── project.nuget.cache
@zivkan
Copy link
Member

zivkan commented Nov 30, 2020

@tmds MSBuild reads these files from MSBuildProjectExtensionsPath due to MSBuild import ordering issues. Furthermore, as described in that issue, you will need to set that path either in Directory.Build.props, or change the Sdk syntax in your csproj so that you can change its value before the SDK's props are imported.

Although it's not the easiest to find, it's documented on our page about msbuild based restore.

@zivkan zivkan closed this as completed Nov 30, 2020
@zivkan zivkan added Functionality:Restore Resolution:ByDesign This issue appears to be ByDesign labels Nov 30, 2020
@tmds
Copy link
Author

tmds commented Nov 30, 2020

you will need to set that path either in Directory.Build.props

This doesn't work for me because $(Configuration) is not yet set, and I want to change the path based on that.

or change the Sdk syntax in your csproj so that you can change its value before the SDK's props are imported.

ok.
It would be nice if this would be possible using the default Sdk import.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Restore Resolution:ByDesign This issue appears to be ByDesign
Projects
None yet
Development

No branches or pull requests

2 participants