2012-02-16 66 views
1

我试图插入一些示例数据(种子数据)使用EF 4.3迁移。设置种子数据时的工作目录

问题是我想从XML文件读取数据。但是,当我运行Update-Database cmdlet时,出现像Could not find a part of the path 'C:\SampleData\'这样的错误。

无论如何,当我从我的PowerShell控制台运行Update-Database时,将工作目录设置为当前项目文件夹。

在此先感谢。

+0

你尝试使用PowerShell命令('得到-location' /'设置位置 “......”')或直接访问.NET API'[System.IO.Directory] ​​:: GetCurrentDirectory()'/'[System.IO.Directory] ​​:: SetCurrentDirectory(“...”)'? – 2012-02-16 13:53:48

+0

我已经尝试.NET API [System.IO.Directory] ​​:: GetCurrentDirectory(),但它不工作。我不想用硬编码的位置设置当前目录。谢谢。 – 2012-02-21 08:23:36

回答