你好 我已經安裝了visual studio express C++項目,包含了包含頭文件和庫的路徑 現在我喜歡將這個項目複製到包含頭文件和庫的相同路徑中 但是,手動進入.vcproj文件並開始更改名稱 有更好的方法嗎?複製visual studio項目的最快方式/腳本是什麼?
4
A
回答
9
也許最簡單快速的方法是使用Windows資源管理器來製作整個項目的副本。您很可能需要爲複製的.vcproj文件分配一個新的唯一GUID。爲此,請在記事本中打開文件,並從guidgen.exe
或類似應用程序中粘貼新的ProjectGUID
。完成之後,只需在Visual Studio中打開重複的項目並重新命名即可。
另外,你可以嘗試像CopyWiz(雖然我從來沒有使用它,有一個免費的試用版可用來查看它是否適用於你)。
除非您正在嘗試爲新項目創建模板,在這種情況下有a better way。
1
如果在PowerShell中運行(在Win 7和其他版本中提供),請編寫這個適用於我的程序 即使它不能正確工作,它也可能是一個很好的起點。
# set the initial values.
[System.Reflection.Assembly]::LoadWithPartialName(「System.Windows.Forms」)
[Windows.Forms.MessageBox]::Show(「This script assumes that each project lives in a directory with the same name as the project, as VC defaults to. Input a) the directory holding both the existing project and the new project. This is the directory CONTAINING the directory with the name of the existing project. It must include the final backslash. b) the name of the existing project. c) the name of the new project」, 「」, [Windows.Forms.MessageBoxButtons]::OK, [Windows.Forms.MessageBoxIcon]::Information)
($myroot=(Read-Host "Enter path of directory holding new and existing projects."))
($projectname=(Read-Host "Enter the name of the project to copy. Must be a single word"))
($newname=(Read-Host "Enter the name of the new project. Must be a single word"))
# make a copy of the original
Set-Location $myroot
Copy-Item "$myroot$projectname" "$myroot$newname" -recurse
# find and rename all files containing the original project name
# run without recurse first or an error occurs
Get-ChildItem $myroot$newname\ -force| Where-Object {$_.name -like "*$projectname*"}| rename-item -newname { $_.name -replace "$projectname","$newname" }
Get-ChildItem $myroot$newname\ -force -recurse| Where-Object {$_.name -like "*$projectname*"}| rename-item -newname { $_.name -replace "$projectname","$newname" }
# find all references within the code to the projectname and change those
Set-Location $myroot$newname
Get-ChildItem -recurse | where {$_.extension -eq ".cpp"-or $_.extension -eq ".h" -or $_.extension -eq ".sln" -or $_.extension -eq ".vcxproj" -or $_.extension -eq ".rc"} `
|foreach-object {(get-content $_.fullname) | foreach-object {$_ -replace "$projectname", "$newname"} | set-content $_.fullname}
# delete sdf and suo files
remove-item $myroot$newname\$newname.suo -force
remove-item $myroot$newname\$newname.sdf -force
#done
相關問題
- 1. 在Visual Studio 2008項目中存儲版本號的最佳方式是什麼?
- 2. 什麼是最快速的工作方式PHP腳本
- 3. Visual Studio腳本項目
- 4. Visual Studio複製項目
- 5. 什麼是從寵物項目中學習的最快方式?
- 6. 什麼是比較兩個項目列表的最快方式?
- 7. 在Visual Studio中摺疊所有項目的最佳/最快/最簡單的方法是什麼?
- 8. 跨Visual Studio版本遷移舊版項目時,最佳方法是什麼?
- 9. 什麼是在Visual Studio中導航到類頂部的最快捷方式
- 10. 什麼是Visual Studio中項目的最佳默認位置?
- 11. 什麼是快捷方式在Visual Studio 2013
- 12. WPF:將項目添加到ListView的最有效/最快的方式是什麼?
- 13. 什麼是支持數據庫項目的Visual Studio 2010的最低版本
- 14. Visual Studio擴展代碼生成...什麼是最好的方式
- 15. 在Visual Studio中調試程序的最佳方式是什麼?
- 16. PHP5 CLI制定基本目錄的最佳方式是什麼?
- 17. 什麼是Visual Studio 2008解決方案中的最佳項目數量?
- 18. 什麼是複製我的陣列的最快方法?
- 19. 什麼是再次通過腳本的最佳方式?
- 20. 在Visual Studio 11中複製一行代碼的快捷方式
- 21. 在visual studio 2010中添加設置項目的快捷方式
- 22. PhoneGap&Visual Studio不復制腳本文件
- 23. PowerShell腳本構建Visual Studio項目
- 24. 什麼是簡單合併文件的最快捷方式,什麼是分割數組的最快捷方式?
- 25. 在mysql中複製表的最快方法是什麼?
- 26. Visual Studio複製依賴項目
- 27. Visual Studio MVC複製粘貼項目
- 28. 複製Visual Studio項目 - 編譯錯誤
- 29. Vsts(原Visual Studio Online)複製項目
- 30. 我的Visual Studio項目中的目錄結構的最佳做法是什麼?
對於那些誰不知道GUIDGEN.EXE的位置: 「C:\ Program Files文件\微軟的SDK \的Windows \ v6.0A \ BIN」(我的系統是Windows 7專業版64位,VS 2005,2008年&2010安裝) – kubilay 2012-09-27 14:51:42