dotnet / dotnet/Scaffolding

Code generator fails to run with custom bin and obj location

Open
#776 3 comments 3 reactions 0 assignees View on GitHub
area-scaffolding
Dominant language
C#
Stars
818
Forks
260
Avg merge
1d 8h
Merged PRs (30d)
10

Description

I followed the instructions at https://www.natemcmaster.com/blog/2017/11/13/dotnet-watch-and-docker/ to setup docker with dotnet watch, which requires moving bin/ and obj/ out of the project folder using a Directory.Build.props file so that docker and Visual Studio Code can work together.

Then when I tried to run dotnet aspnet-codegenerator it failed with the following error (also an obj/ folder is created in the project):

> Scaffolding failed.
> Failed to get Project Context for .
>
> To see more information, enable tracing by setting environment variable 'codegen_trace' = 1.
> RunTime 00:00:00.95

If I remove the Directory.Build.props file then the code generator runs without error.

It seems that the tool does not read the settings inside Directory.Build.props and does not provide a way to specify the path to the obj/ folder (e.g. dotnet ef supports --msbuildprojectextensionspath).

Is there any other way to get the code generator to run other than removing Directory.Build.props?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.