默认情况下,附加迁移命令尝试在是否可以更改EF Migrations“Migrations”文件夹的位置?
- 项目以创建迁移cs文件根
- 迁移
我想沿着存储我的迁移与我的项目的\ Data文件夹中其余的EF相关的代码:
- 项目根
- 数据
- 迁移
- 数据
采用这种结构,当我在的NuGet控制台收到以下错误执行
PM> add-migration Migration1
:
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)
是否可以指定磁盘上执行add-migration命令时应创建迁移文件的位置?
请标记罗杰的解决方案作为答案。它为我工作。谢谢。 – jordanbtucker 2012-09-04 17:09:22