Theo mặc định, lệnh add-di nỗ lực để tạo ra tập tin sự di cư cs trongCó thể thay đổi vị trí của thư mục di chuyển "Di cư" EF không?
- Dự án gốc
- Migrations
Tôi muốn để lưu trữ di cư của tôi cùng với phần còn lại của mã liên quan đến EF của tôi trong thư mục \ Data của dự án của tôi:
- Dự án gốc
- liệu
- Migrations
- liệu
Với cấu trúc này, khi tôi thực hiện
PM> add-migration Migration1
trong NuGet console tôi nhận được lỗi sau:
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\MyProjectRoot\Migrations\201112171635110_Migration1.cs'. 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) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamWriter.CreateFile(String path, Boolean append) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding) at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding) at System.IO.File.WriteAllText(String path, String contents)
Có thể chỉ định vị trí trên đĩa mà tệp di chuyển sẽ được tạo khi thực hiện lệnh thêm di chuyển không?
Vui lòng đánh dấu giải pháp của Roger là câu trả lời. Nó làm việc cho tôi. Cảm ơn. – jordanbtucker