-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
CLI Tools: Error when MSBuildProjectExtensionsPath doesn't exist #8816
Comments
Hmm, there's definitely an issue here. To get it to work as it was intended, you'd have to author your <Project>
<PropertyGroup>
<BaseIntermediateOutputPath>../../obj/$(MSBuildProjectName)/</BaseIntermediateOutputPath>
</PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<!-- Typical content goes here. -->
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project> For your scenario, not specifying |
Triage, I think we have two options here:
|
Yeah, I succeeded to scaffold it by manually creating I tried to modify the csprojs as you suggested. However I was still unsuccessful in using
This also created the folder as specified in the csproj: I pointed
Did I misconfigure something? Thanks. |
It sounds like you left the |
Yeah, sorry. Tinkering with csprojs at 3AM wasn't a good idea. The error remains however, except no warnings this time. Since I spent way too much time playing with this I'll just leave |
We decided to go with option 1: Keep everything as is, but create the directory if it doesn't exist. That fact that dotnet/sdk (or maybe it's Microsoft/msbuild) makes it difficult to override the value of |
This causes issues with Entity Framework Core's ability to create migration projects. It is fairly hard coded to look into the obj directory. Trying to make it work with the global Binaries directory was just swimming upstream. Decided to simplify a bit since I'm already paying the learner tax on EF. No reason to add more by fighting the system. Further reading - dotnet/efcore#8816
This causes issues with Entity Framework Core's ability to create migration projects. It is fairly hard coded to look into the obj directory. Trying to make it work with the global Binaries directory was just swimming upstream. Decided to simplify a bit since I'm already paying the learner tax on EF. No reason to add more by fighting the system. Further reading - dotnet/efcore#8816
Hello, I have trouble scaffolding an existing Sqlite database model when a separate netstandard1.6 class library is used as a DataLayer project and
BaseIntermediateOutputPath
is set to a differentobj/
folder with--msbuildprojectextensionspath
, as per example below:Directory structure:
projects.DataLayer.csproj
project.WebApp.csproj
For the below commands I am positioned in project.DataLayer folder and I ran
dotnet restore
anddotnet build
on all projects.When I try to scaffold the database from
/src/project.DataLayer
with--msbuildprojectextensionspath
pointing to/out/project.DataLayer/obj/
:I get this error, but, if I remove
BaseOutputPath
andBaseIntermediateOutputPath
from both csprojs (then thebin/
andobj/
folders are created in the/src/project.DataLayer
folder afterdotnet restore
anddotnet build
) and execute the following command from that folder:then the command is executed successfully and the model is created.
Please note that
Scaffold-DbContext
works in VS2017 Package Manager Console when I pick project.DataLayer and execute scaffolding with the same configuration (/bin
and/obj
in separate directory).EF Core version: 1.1.2
Database Provider: Microsoft.EntityFrameworkCore.Sqlite
Operating system: Windows 10
IDE: Visual Studio Code / CLI Tools
The text was updated successfully, but these errors were encountered: