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

Script migration fails if directory does not exist #5535

Closed
natemcmaster opened this issue May 26, 2016 · 0 comments
Closed

Script migration fails if directory does not exist #5535

natemcmaster opened this issue May 26, 2016 · 0 comments
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

natemcmaster commented May 26, 2016

Steps to reproduce

dotnet ef migrations script -o ./some/folder/that/doesnt/exist.sql

The issue

System.IO.DirectoryNotFoundException: Could not find a part of the path 
'C:\Users\namc\dev\ef\some\folder\that\doesnt\exist.sql'.    at System.IO.Win32FileStream..ctor(String 
path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, 
FileStream parent) 

at System.IO.Win32FileSystem.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent) 
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) 
    at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding) 
   at System.IO.File.WriteAllText(String path, String contents, Encoding encoding)
    at Microsoft.EntityFrameworkCore.Tools.Cli.MigrationsScriptCommand.Execute(CommonOptions commonOptions, String from, String to, String output, Boolean idempotent, String context, String environment) 
    at Microsoft.EntityFrameworkCore.Tools.Cli.MigrationsScriptCommand.<>c__DisplayClass0_0.<Configure>b__0() 
    at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
    at Microsoft.EntityFrameworkCore.Tools.Cli.Program.Main(String[] args) 

Workaround

Make the directory manually first.

@rowanmiller rowanmiller added this to the 1.0.1 milestone May 26, 2016
natemcmaster pushed a commit to natemcmaster/EntityFrameworkCore that referenced this issue Jun 21, 2016
natemcmaster pushed a commit to natemcmaster/EntityFrameworkCore that referenced this issue Jun 21, 2016
@natemcmaster natemcmaster added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jul 6, 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

3 participants