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 for ASP.NET Core project on .NET Framework #6465

Closed
divega opened this issue Sep 3, 2016 · 2 comments
Closed

Script-Migration fails for ASP.NET Core project on .NET Framework #6465

divega opened this issue Sep 3, 2016 · 2 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

@divega
Copy link
Contributor

divega commented Sep 3, 2016

Steps to reproduce

  1. Create a new ASP.NET Core Web Application (.NET Framework) project with individual authentication in VS
  2. Create an empty migration Foo
  3. Execute the following command in PMC
    Script-Migration -From Foo -To 0

The issue

I get an error like the following:

System.IO.DirectoryNotFoundException: Could not find a part of the path 'c:\users\divega\documents\visual studio 2015\Projects\WebApplication11\src\WebApplication11\obj\Debug\hbbtvqqz.sql'.    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) 
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
    at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost) 
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost)
    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)
 Could not find a part of the path 'c:\users\divega\documents\visual studio 2015\Projects\WebApplication11\src\WebApplication11\obj\Debug\hbbtvqqz.sql'. 

Workarounds

Manually create the obj\Debug

Further technical details

EF Core version: 1.0.0 and 1.0.1
Operating system: Windows 10
Visual Studio version: 2015

@divega divega added this to the 1.1.0 milestone Sep 7, 2016
@divega
Copy link
Contributor Author

divega commented Sep 7, 2016

We should figure out if this is already fixed for 1.1.0.

@bricelam
Copy link
Contributor

bricelam commented Oct 5, 2016

It appears that this has been fixed.

@bricelam bricelam closed this as completed Oct 5, 2016
@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 Oct 5, 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