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

PMC + xproj: dotnet-ef uses incorrect build directory #6335

Closed
natemcmaster opened this issue Aug 16, 2016 · 1 comment
Closed

PMC + xproj: dotnet-ef uses incorrect build directory #6335

natemcmaster opened this issue Aug 16, 2016 · 1 comment
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@natemcmaster
Copy link
Contributor

Steps to reproduce

File -> New ASP.NET Web Application (.NET Core)
Install Microsoft.EntityFrameworkCore.Tools 1.0.0-preview2-final
Add-Migration Initial -Verbose

The issue

PMC cmdlets will call dotnet-ef with the incorrect build base path option. In project that use global.json, this can cause .NET Core SDK to use ./bin/src/<projectName>/bin/ as the build directory instead of just ./bin/.

e.g.:

dotnet ef --build-base-path .\bin dbcontext list --verbose

In many cases, the PMC command will continue to function correctly. However, this causes problems for projects using SQLite and Update-Database. See aspnet/Microsoft.Data.Sqlite#275. In other cases, it causes misleading "class libraries not supported" errors.

Further technical details

PMC uses DTE to determine build base path. Before preview2, the behavior of web tooling in VS was to build in <solutionRoot>/bin/<projectName>. This was changed for preview 2 to instead use <projectDirectory>/bin/. dotnet-ef preview2 still uses the original behavior.

EF Core version: 1.0.0-preview2-final tooling
Visual Studio version: VS 2015 U3, Web Tooling Preview 2

Workaround

Use dotnet-ef directly and don't pass in the --build-base-path option.
Use absolute paths in connection strings for SQLite.

@bricelam
Copy link
Contributor

I believe this issue went away with #6288.

@bricelam bricelam added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Sep 29, 2016
@ajcvickers ajcvickers modified the milestones: 1.1.0-preview1, 1.1.0 Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

4 participants