1
我試圖插入一些示例數據(種子數據)使用EF 4.3遷移。設置種子數據時的工作目錄
問題是我想從XML文件讀取數據。但是,當我運行Update-Database
cmdlet時,出現像Could not find a part of the path 'C:\SampleData\'
這樣的錯誤。
無論如何,當我從我的PowerShell控制檯運行Update-Database
時,將工作目錄設置爲當前項目文件夾。
在此先感謝。
你嘗試使用PowerShell命令('得到-location' /'設置位置 「......」')或直接訪問.NET API'[System.IO.Directory] :: GetCurrentDirectory()'/'[System.IO.Directory] :: SetCurrentDirectory(「...」)'? – 2012-02-16 13:53:48
我已經嘗試.NET API [System.IO.Directory] :: GetCurrentDirectory(),但它不工作。我不想用硬編碼的位置設置當前目錄。謝謝。 – 2012-02-21 08:23:36